Exception: ServiceObjects::Invalid
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- ServiceObjects::Invalid
- Defined in:
- lib/service_objects/invalid.rb
Overview
The exception to be risen by invalid services
Instance Attribute Summary collapse
-
#object ⇒ #messages
readonly
Invalid service object.
Class Method Summary collapse
-
.initialize(object) ⇒ ServiceObjects::Invalid
Constructs the exception for given service object.
Instance Method Summary collapse
-
#messages ⇒ Array<ServiceObjects::Message>
The array of messages from the invalid #object.
-
#new(object) ⇒ ServiceObjects::Invalid
Constructs the exception for given service object.
Instance Attribute Details
#object ⇒ #messages (readonly)
Invalid service object
31 32 33 |
# File 'lib/service_objects/invalid.rb', line 31 def object @object end |
Class Method Details
.initialize(object) ⇒ ServiceObjects::Invalid
Constructs the exception for given service object
22 23 24 25 |
# File 'lib/service_objects/invalid.rb', line 22 def initialize(object) @object = object validate end |
Instance Method Details
#messages ⇒ Array<ServiceObjects::Message>
The array of messages from the invalid #object
36 37 38 |
# File 'lib/service_objects/invalid.rb', line 36 def Array(object.).flatten end |
#new(object) ⇒ ServiceObjects::Invalid
Constructs the exception for given service object
22 23 24 25 |
# File 'lib/service_objects/invalid.rb', line 22 def initialize(object) @object = object validate end |