Class: Newslettre::Lists::Object
- Inherits:
-
Struct
- Object
- Struct
- Newslettre::Lists::Object
- Extended by:
- Forwardable
- Defined in:
- lib/newslettre/lists.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#list ⇒ Object
Returns the value of attribute list.
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
2 3 4 |
# File 'lib/newslettre/lists.rb', line 2 def data @data end |
#list ⇒ Object
Returns the value of attribute list
2 3 4 |
# File 'lib/newslettre/lists.rb', line 2 def list @list end |
#owner ⇒ Object
Returns the value of attribute owner
2 3 4 |
# File 'lib/newslettre/lists.rb', line 2 def owner @owner end |
Instance Method Details
#==(other) ⇒ Object
8 9 10 |
# File 'lib/newslettre/lists.rb', line 8 def == other self.to_hash == other end |
#emails ⇒ Object
24 25 26 |
# File 'lib/newslettre/lists.rb', line 24 def emails @emails ||= Newslettre::APIModuleProxy.new self, Email.new(self.list, self.api) end |
#load_data ⇒ Object
12 13 14 15 16 |
# File 'lib/newslettre/lists.rb', line 12 def load_data loaded = request('get', :list => self.list).first raise Newslettre::API::ClientFailure, "missing #{self.list}" if loaded.nil? self.data ||= loaded.to_hash end |
#to_hash ⇒ Object
18 19 20 21 22 |
# File 'lib/newslettre/lists.rb', line 18 def to_hash load_data data end |