Class: Marvell::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/marvell/entity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#resultObject (readonly)

Returns the value of attribute result.



6
7
8
# File 'lib/marvell/entity.rb', line 6

def result
  @result
end