Class: Operation
- Inherits:
-
Object
- Object
- Operation
- Defined in:
- lib/operation/core.rb,
lib/operation/version.rb,
lib/operation/deferrable.rb,
lib/operation/deferrable.rb
Defined Under Namespace
Modules: Deferrable, VERSION Classes: Defer
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(options = {}) ⇒ Operation
constructor
A new instance of Operation.
- #meta ⇒ Object
- #metamash ⇒ Object
-
#object ⇒ Object
Convenience Wrapper.
- #success? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Operation
Returns a new instance of Operation.
4 5 6 |
# File 'lib/operation/core.rb', line 4 def initialize( = {}) = end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
2 3 4 |
# File 'lib/operation/core.rb', line 2 def code @code end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
2 3 4 |
# File 'lib/operation/core.rb', line 2 def end |
Instance Method Details
#failure? ⇒ Boolean
12 13 14 |
# File 'lib/operation/core.rb', line 12 def failure? !success? end |
#meta ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/operation/core.rb', line 32 def if defined? Hashie::Mash else end end |
#metamash ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/operation/core.rb', line 40 def if .respond_to? :each_pair Hashie::Mash.new elsif else Hashie::Mash.new end end |
#object ⇒ Object
Convenience Wrapper
22 23 24 25 26 |
# File 'lib/operation/core.rb', line 22 def object [:object] || ['object'] || .object rescue nil end |
#success? ⇒ Boolean
8 9 10 |
# File 'lib/operation/core.rb', line 8 def success? [true, 'true', 1, '1'].include? [:success] end |