Class: Weese::Rail::Line::String
- Inherits:
-
Object
- Object
- Weese::Rail::Line::String
- Defined in:
- lib/weese/rail/line.rb
Overview
Extensions to String relating to Lines
Instance Method Summary collapse
-
#line? ⇒ bool
Checks if this String is a Line code.
-
#line_name ⇒ String
Line name for the current Line.
Instance Method Details
#line? ⇒ bool
Checks if this Weese::Rail::Line::String is a Line code
22 23 24 25 26 27 28 29 |
# File 'lib/weese/rail/line.rb', line 22 def line? case self when Line::RD, Line::BL, Line::YL, Line::YL, Line::OR, Line::GR, Line::SV, Line::YLRP true else false end end |
#line_name ⇒ String
Line name for the current Line
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/weese/rail/line.rb', line 36 def line_name case self when Line::RD 'Red' when Line::BL 'Blue' when Line::YL 'Yellow' when Line::OR 'Orange' when Line::GR 'Green' when Line::SV 'Silver' when Line::YLRP 'Yellow Line Rush Plus' else raise 'Invalid line' end end |