Skip to content

Commit

Permalink
Merge branch 'hotfix/readme'
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed May 27, 2014
2 parents 7fb3d4f + b9f0348 commit 8c35dde
Showing 1 changed file with 1 addition and 41 deletions.
42 changes: 1 addition & 41 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,47 +105,7 @@ Here is an example :
:description => "some description about this method to show in the documentation"


The exception classes used <b>must inherit</b> from <tt>WashOut::Dispatcher::SOAPError</tt>, which has by default a error code and a message as attributes but you can extend it by adding more attributes to your own custom class.

The WashOut::SoapError now includes Virtus.model from +virtus+ gem. This way you can add attributes like this:

class MyCustomSoapError < WashOut::Dispatcher::SOAPError

attribute :custom_attribute, String
attribute :other_custom_attribute, Integer

end

You can also specify complex types like this:

class MyCustomSoapError < WashOut::Dispatcher::SOAPError

attribute :errors,Array[Integer]
attribute :custom, Array[MyCustomModel]
attribute :custom2, MyCustomModel

end

<b>The class MyCustomModel must include +Virtus.model+ or +Virtus.value_object+ or it must include at least one module that includes +Virtus.module+ if you want it to show up in the documentation!
Please checkout {Virtus Gem}[https://github.com/solnic/virtus] for further documentation!</b>

You can also use aggregation with another fault class exception like this:

class MyCustomSoapError < WashOut::Dispatcher::SOAPError

attribute :errors, Array[MyOtherCustomSoapError]

end

And you can also use inheritance between custom exception classes like this:

class MySecondCustomSoapError < MyCustomSoapError

atribute :option , String

end

And you will see in the documentation that the class +MySecondCustomSoapError+ will extend +MyCustomSoapError+
The exception classes used <b>must inherit</b> from <tt>WashOut::Dispatcher::SOAPError</tt>, which has by default a error code and a message as attributes .

= Testing

Expand Down

0 comments on commit 8c35dde

Please sign in to comment.