Class: Servicify::Object
- Inherits:
-
Object
- Object
- Servicify::Object
- Defined in:
- lib/servicify/object.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
9 10 11 |
# File 'lib/servicify/object.rb', line 9 def result @result end |
Class Method Details
.call(*arg) ⇒ Object
4 5 6 |
# File 'lib/servicify/object.rb', line 4 def call(*arg) new(*arg).constructor end |
Instance Method Details
#call ⇒ Object
27 28 29 |
# File 'lib/servicify/object.rb', line 27 def call fail NotImplementedError unless defined?(super) end |
#constructor ⇒ Object
10 11 12 13 |
# File 'lib/servicify/object.rb', line 10 def constructor @result = call self end |
#errors ⇒ Object
23 24 25 |
# File 'lib/servicify/object.rb', line 23 def errors @errors ||= Servicify::Common::Errors.new end |
#failure? ⇒ Boolean
19 20 21 |
# File 'lib/servicify/object.rb', line 19 def failure? errors.any? end |
#success? ⇒ Boolean
15 16 17 |
# File 'lib/servicify/object.rb', line 15 def success? !failure? end |