Module: JapanETC::Direction

Defined in:
lib/japan_etc/direction.rb

Constant Summary collapse

INBOUND =
'上り'
OUTBOUND =
'下り'
CLOCKWISE =
'外回り'
COUNTERCLOCKWISE =
'内回り'
NORTH =
'北行き'
SOUTH =
'南行き'
EAST =
'東行き'
WEST =
'西行き'

Class Method Summary collapse

Class Method Details

.from(text) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/japan_etc/direction.rb', line 14

def self.from(text)
  case text
  when '上り', ''
    INBOUND
  when '下り', ''
    OUTBOUND
  when '外回り', ''
    CLOCKWISE
  when '内回り', ''
    COUNTERCLOCKWISE
  when /北行/, ''
    NORTH
  when /南行/, ''
    SOUTH
  when /東行/, ''
    EAST
  when /西行/, '西'
    WEST
  end
end