Class: Marvell::Entity
- Inherits:
-
Object
- Object
- Marvell::Entity
- Defined in:
- lib/marvell/entity.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(json_result) ⇒ Entity
constructor
A new instance of Entity.
- #method_missing(method_name, *arguments, &block) ⇒ Object
Constructor Details
#initialize(json_result) ⇒ Entity
3 4 5 |
# File 'lib/marvell/entity.rb', line 3 def initialize(json_result) @result = json_result end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object
8 9 10 11 |
# File 'lib/marvell/entity.rb', line 8 def method_missing(method_name, *arguments, &block) attribute = result[method_name.to_s.camel_case] attribute ? attribute : super end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
6 7 8 |
# File 'lib/marvell/entity.rb', line 6 def result @result end |