Sha256: 0814c227525e3dbf311223151dd850fd711569d70f9a0cae66e53f619d4b5f2c

Contents?: true

Size: 761 Bytes

Versions: 16

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
japan_etc-0.14.0 lib/japan_etc/direction.rb
japan_etc-0.13.0 lib/japan_etc/direction.rb
japan_etc-0.12.0 lib/japan_etc/direction.rb
japan_etc-0.11.0 lib/japan_etc/direction.rb
japan_etc-0.10.0 lib/japan_etc/direction.rb
japan_etc-0.9.0 lib/japan_etc/direction.rb
japan_etc-0.8.0 lib/japan_etc/direction.rb
japan_etc-0.7.0 lib/japan_etc/direction.rb
japan_etc-0.6.0 lib/japan_etc/direction.rb
japan_etc-0.5.2 lib/japan_etc/direction.rb
japan_etc-0.5.1 lib/japan_etc/direction.rb
japan_etc-0.5.0 lib/japan_etc/direction.rb
japan_etc-0.4.0 lib/japan_etc/direction.rb
japan_etc-0.3.0 lib/japan_etc/direction.rb
japan_etc-0.2.0 lib/japan_etc/direction.rb
japan_etc-0.1.0 lib/japan_etc/direction.rb