Class: Rzd::Train
- Inherits:
-
Struct
- Object
- Struct
- Rzd::Train
- Defined in:
- lib/rzd/train.rb
Constant Summary collapse
- SEATS =
['Л','К','П','С']
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#num ⇒ Object
Returns the value of attribute num.
-
#seats ⇒ Object
Returns the value of attribute seats.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
1 2 3 |
# File 'lib/rzd/train.rb', line 1 def name @name end |
#num ⇒ Object
Returns the value of attribute num
1 2 3 |
# File 'lib/rzd/train.rb', line 1 def num @num end |
#seats ⇒ Object
Returns the value of attribute seats
1 2 3 |
# File 'lib/rzd/train.rb', line 1 def seats @seats end |
Instance Method Details
#seat_table ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/rzd/train.rb', line 5 def seat_table str = "" SEATS.each do |s| str += seats.include?(s) ? s : " " str += " " end str end |