Class: RelateIQ::Resource
- Inherits:
-
Object
- Object
- RelateIQ::Resource
- Defined in:
- lib/relate_iq/resource.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Resource
constructor
A new instance of Resource.
- #inspect ⇒ Object
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Resource
Returns a new instance of Resource.
3 4 5 |
# File 'lib/relate_iq/resource.rb', line 3 def initialize(attributes) @__source__ = OpenStruct.new(attributes) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
7 8 9 |
# File 'lib/relate_iq/resource.rb', line 7 def method_missing(method, *args, &block) @__source__.send(method, *args, &block) end |
Instance Method Details
#inspect ⇒ Object
11 12 13 |
# File 'lib/relate_iq/resource.rb', line 11 def inspect @__source__.inspect.gsub('<OpenStruct', "<#{self.class.to_s}") end |