Class: Servicify::Object
- Inherits:
-
Object
- Object
- Servicify::Object
- Defined in:
- lib/servicify/object.rb
Direct Known Subclasses
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, **opts) ⇒ Object
4 5 6 |
# File 'lib/servicify/object.rb', line 4 def call(*arg, **opts) new(*arg, **opts).constructor end |
Instance Method Details
#call ⇒ Object
28 29 30 |
# File 'lib/servicify/object.rb', line 28 def call fail NotImplementedError unless defined?(super) end |
#constructor ⇒ Object
11 12 13 14 |
# File 'lib/servicify/object.rb', line 11 def constructor @result = call self end |
#errors ⇒ Object
24 25 26 |
# File 'lib/servicify/object.rb', line 24 def errors @errors ||= Servicify::Common::Errors.new end |
#failure? ⇒ Boolean
20 21 22 |
# File 'lib/servicify/object.rb', line 20 def failure? errors.any? end |
#success? ⇒ Boolean
16 17 18 |
# File 'lib/servicify/object.rb', line 16 def success? !failure? end |