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