class Weese::Rail::Line::String

Extensions to String relating to Lines

Public Instance Methods

line?() click to toggle source

Checks if this {String} is a Line code

@return [bool] If the current string is a Line Code

# 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() click to toggle source

Line name for the current Line

@return [String] Human-presentable Line name

# 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