Class: Newslettre::Letter::Object
- Inherits:
-
Struct
- Object
- Struct
- Newslettre::Letter::Object
- Extended by:
- Forwardable
- Defined in:
- lib/newslettre/letter.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#name ⇒ Object
Returns the value of attribute name.
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #deschedule! ⇒ Object
- #load_data ⇒ Object
- #recipients ⇒ Object
- #schedule ⇒ Object
- #schedule!(options = {}) ⇒ Object
- #scheduled? ⇒ Boolean
- #to_hash ⇒ Object
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
2 3 4 |
# File 'lib/newslettre/letter.rb', line 2 def data @data end |
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'lib/newslettre/letter.rb', line 2 def name @name end |
#owner ⇒ Object
Returns the value of attribute owner
2 3 4 |
# File 'lib/newslettre/letter.rb', line 2 def owner @owner end |
Instance Method Details
#==(other) ⇒ Object
8 9 10 |
# File 'lib/newslettre/letter.rb', line 8 def == other self.to_hash == other end |
#deschedule! ⇒ Object
26 27 28 |
# File 'lib/newslettre/letter.rb', line 26 def deschedule! scheduler.delete end |
#load_data ⇒ Object
12 13 14 |
# File 'lib/newslettre/letter.rb', line 12 def load_data self.data ||= request('get', :name => self.name).to_hash end |
#recipients ⇒ Object
42 43 44 |
# File 'lib/newslettre/letter.rb', line 42 def recipients @recipients ||= Newslettre::APIModuleProxy.new self, Recipients.new(self.name, self.api) end |
#schedule ⇒ Object
22 23 24 |
# File 'lib/newslettre/letter.rb', line 22 def schedule scheduler.get end |
#schedule!(options = {}) ⇒ Object
30 31 32 |
# File 'lib/newslettre/letter.rb', line 30 def schedule! = {} scheduler.deliver end |
#scheduled? ⇒ Boolean
34 35 36 37 38 39 40 |
# File 'lib/newslettre/letter.rb', line 34 def scheduled? begin !!schedule rescue NotScheduledFailure false end end |
#to_hash ⇒ Object
16 17 18 19 20 |
# File 'lib/newslettre/letter.rb', line 16 def to_hash load_data data end |