Class: RelateIQ::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/relate_iq/resource.rb

Direct Known Subclasses

Account, Contact, ListItem

Instance Method Summary collapse

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

#inspectObject



11
12
13
# File 'lib/relate_iq/resource.rb', line 11

def inspect
  @__source__.inspect.gsub('<OpenStruct', "<#{self.class.to_s}")
end