Class: Ripdiru::Program
- Inherits:
-
Object
- Object
- Ripdiru::Program
- Defined in:
- lib/ripdiru.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#from ⇒ Object
Returns the value of attribute from.
-
#id ⇒ Object
Returns the value of attribute id.
-
#info ⇒ Object
Returns the value of attribute info.
-
#station ⇒ Object
Returns the value of attribute station.
-
#title ⇒ Object
Returns the value of attribute title.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
- #effective_date ⇒ Object
-
#initialize(args = {}) ⇒ Program
constructor
A new instance of Program.
- #recording_duration ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Program
Returns a new instance of Program.
125 126 127 128 129 |
# File 'lib/ripdiru.rb', line 125 def initialize(args = {}) args.each do |k, v| send "#{k}=", v end end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
124 125 126 |
# File 'lib/ripdiru.rb', line 124 def duration @duration end |
#from ⇒ Object
Returns the value of attribute from.
124 125 126 |
# File 'lib/ripdiru.rb', line 124 def from @from end |
#id ⇒ Object
Returns the value of attribute id.
124 125 126 |
# File 'lib/ripdiru.rb', line 124 def id @id end |
#info ⇒ Object
Returns the value of attribute info.
124 125 126 |
# File 'lib/ripdiru.rb', line 124 def info @info end |
#station ⇒ Object
Returns the value of attribute station.
124 125 126 |
# File 'lib/ripdiru.rb', line 124 def station @station end |
#title ⇒ Object
Returns the value of attribute title.
124 125 126 |
# File 'lib/ripdiru.rb', line 124 def title @title end |
#to ⇒ Object
Returns the value of attribute to.
124 125 126 |
# File 'lib/ripdiru.rb', line 124 def to @to end |
Instance Method Details
#effective_date ⇒ Object
131 132 133 134 |
# File 'lib/ripdiru.rb', line 131 def effective_date time = from.hour < 5 ? from - 24 * 60 * 60 : from Date.new(time.year, time.month, time.day) end |
#recording_duration ⇒ Object
136 137 138 |
# File 'lib/ripdiru.rb', line 136 def recording_duration (to - Time.now).to_i end |