Class: SFCBus::Bus
- Inherits:
-
Object
- Object
- SFCBus::Bus
- Defined in:
- lib/sfcbus/bus.rb
Instance Attribute Summary collapse
-
#day_type ⇒ Object
readonly
Returns the value of attribute day_type.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#hour ⇒ Object
readonly
Returns the value of attribute hour.
-
#is_rotary ⇒ Object
readonly
Returns the value of attribute is_rotary.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #day_type_jp ⇒ Object
- #from_jp ⇒ Object
-
#initialize(params) ⇒ Bus
constructor
A new instance of Bus.
- #inspect_time ⇒ Object
- #rotary? ⇒ Boolean
- #to_jp ⇒ Object
- #type_jp ⇒ Object
Constructor Details
#initialize(params) ⇒ Bus
Returns a new instance of Bus.
7 8 9 |
# File 'lib/sfcbus/bus.rb', line 7 def initialize(params) params.each { |k, v| instance_variable_set("@#{k}", v) } end |
Instance Attribute Details
#day_type ⇒ Object (readonly)
Returns the value of attribute day_type.
5 6 7 |
# File 'lib/sfcbus/bus.rb', line 5 def day_type @day_type end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
5 6 7 |
# File 'lib/sfcbus/bus.rb', line 5 def from @from end |
#hour ⇒ Object (readonly)
Returns the value of attribute hour.
5 6 7 |
# File 'lib/sfcbus/bus.rb', line 5 def hour @hour end |
#is_rotary ⇒ Object (readonly)
Returns the value of attribute is_rotary.
5 6 7 |
# File 'lib/sfcbus/bus.rb', line 5 def is_rotary @is_rotary end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
5 6 7 |
# File 'lib/sfcbus/bus.rb', line 5 def min @min end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
5 6 7 |
# File 'lib/sfcbus/bus.rb', line 5 def to @to end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/sfcbus/bus.rb', line 5 def type @type end |
Instance Method Details
#day_type_jp ⇒ Object
27 28 29 |
# File 'lib/sfcbus/bus.rb', line 27 def day_type_jp SFCBus::DayTypes::JP[@day_type] end |
#from_jp ⇒ Object
15 16 17 |
# File 'lib/sfcbus/bus.rb', line 15 def from_jp SFCBus::Locations::JP[@from] end |
#inspect_time ⇒ Object
31 32 33 |
# File 'lib/sfcbus/bus.rb', line 31 def inspect_time "#{@hour.to_s.rjust(2, '0')}:#{@min.to_s.rjust(2, '0')}" end |
#rotary? ⇒ Boolean
11 12 13 |
# File 'lib/sfcbus/bus.rb', line 11 def rotary? @is_rotary end |