Class: RailwayJp::Line
- Inherits:
-
Object
- Object
- RailwayJp::Line
- Defined in:
- lib/railway_jp/line.rb
Constant Summary collapse
- MAPPINGS =
{ id: 'line_cd', name: 'line_name', color: 'line_color_c', }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(row) ⇒ Line
constructor
A new instance of Line.
Constructor Details
Class Method Details
.all ⇒ Object
10 11 12 |
# File 'lib/railway_jp/line.rb', line 10 def all @all ||= data.map { |row| new(row) } end |
.find(id) ⇒ Object
14 15 16 17 |
# File 'lib/railway_jp/line.rb', line 14 def find(id) row = data_index_by_id[id.to_s] row ? new(row) : nil end |