Class: DVB::Departure
- Inherits:
-
Object
- Object
- DVB::Departure
- Defined in:
- lib/dvb/monitor.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#relative_time ⇒ Object
readonly
Returns the value of attribute relative_time.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(line, direction, relative_time) ⇒ Departure
constructor
A new instance of Departure.
- #mode ⇒ Object
- #time ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(line, direction, relative_time) ⇒ Departure
Returns a new instance of Departure.
26 27 28 29 30 |
# File 'lib/dvb/monitor.rb', line 26 def initialize(line, direction, relative_time) @line = line @direction = direction @relative_time = relative_time end |
Instance Attribute Details
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
20 21 22 |
# File 'lib/dvb/monitor.rb', line 20 def direction @direction end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
20 21 22 |
# File 'lib/dvb/monitor.rb', line 20 def line @line end |
#relative_time ⇒ Object (readonly)
Returns the value of attribute relative_time.
20 21 22 |
# File 'lib/dvb/monitor.rb', line 20 def relative_time @relative_time end |
Class Method Details
Instance Method Details
#mode ⇒ Object
36 37 38 |
# File 'lib/dvb/monitor.rb', line 36 def mode DVB::parse_mode(@line) end |
#time ⇒ Object
32 33 34 |
# File 'lib/dvb/monitor.rb', line 32 def time Time.now + @relative_time * 60 end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/dvb/monitor.rb', line 40 def to_s "#{@line} #{direction} @ #{time}" end |