Module: Tron::Resultable
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Class Method Summary collapse
Instance Method Summary collapse
- #code ⇒ Object
- #failure? ⇒ Boolean
- #initialize(code: nil, metadata: nil) ⇒ Object
- #meta ⇒ Object
-
#object ⇒ Object
Convenience Wrapper.
- #success? ⇒ Boolean
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/tron/resultable.rb', line 3 def @metadata end |
Class Method Details
.included(receiver) ⇒ Object
5 6 7 |
# File 'lib/tron/resultable.rb', line 5 def self.included(receiver) receiver.extend ::Tron::Resultable::ClassMethods end |
Instance Method Details
#code ⇒ Object
29 30 31 32 |
# File 'lib/tron/resultable.rb', line 29 def code return if @code.to_s == '' @code.to_s.to_sym end |
#failure? ⇒ Boolean
25 26 27 |
# File 'lib/tron/resultable.rb', line 25 def failure? is_a? ::Tron::Failure end |
#initialize(code: nil, metadata: nil) ⇒ Object
16 17 18 19 |
# File 'lib/tron/resultable.rb', line 16 def initialize(code: nil, metadata: nil) @code = code @metadata = end |
#meta ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/tron/resultable.rb', line 41 def if defined? ::Hashie::Mash else end end |
#object ⇒ Object
Convenience Wrapper
35 36 37 38 39 |
# File 'lib/tron/resultable.rb', line 35 def object [:object] || ['object'] rescue nil end |