Module: TokyoMetro::Modules::Common::Dictionary::OperationDay

Includes:
ConvertConstantToClassMethod
Defined in:
lib/tokyo_metro/modules/common/dictionary/operation_day.rb

Class Method Summary collapse

Class Method Details

.constants_except_for_class_methodsObject



10
11
12
# File 'lib/tokyo_metro/modules/common/dictionary/operation_day.rb', line 10

def self.constants_except_for_class_methods
  ( self.constants - [ :ClassMethods ] )
end

.hash_listObject



21
22
23
24
25
26
27
28
# File 'lib/tokyo_metro/modules/common/dictionary/operation_day.rb', line 21

def self.hash_list
  h = ::Hash.new
  constants_except_for_class_methods.each do | const_name |
    h_const = const_get( const_name )
    h[ h_const[ :name_en ] ] = h_const
  end
  h
end

.listObject



14
15
16
17
18
19
# File 'lib/tokyo_metro/modules/common/dictionary/operation_day.rb', line 14

def self.list
  constants_except_for_class_methods.map { | const_name |
    h = const_get( const_name )
    [ h[ :name_ja ] , h[ :name_en ] ]
  }
end