Class: Contactology::ListProxy

Inherits:
BasicObject
Defined in:
lib/contactology/list_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasicObject

#raise

Constructor Details

#initialize(list_id) ⇒ ListProxy

Returns a new instance of ListProxy.



10
11
12
# File 'lib/contactology/list_proxy.rb', line 10

def initialize(list_id)
  @list_id = list_id
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



22
23
24
25
# File 'lib/contactology/list_proxy.rb', line 22

def method_missing(method, *args, &block)
  @list ||= get_list(list_id)
  @list.send(method, *args, &block) if @list
end

Instance Attribute Details

#list_idObject (readonly)

Returns the value of attribute list_id.



8
9
10
# File 'lib/contactology/list_proxy.rb', line 8

def list_id
  @list_id
end