module TokyoMetro::ClassNameLibrary::Static::Station::ClassMethods

Public Instance Methods

db_instance_class() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 48
def db_instance_class
  ::Station
end
factory_for_generating_from_each_saved_file() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 28
def factory_for_generating_from_each_saved_file
  ::TokyoMetro::Factory::Generate::Static::Station::InEachRailwayLine
end
factory_for_generating_from_hash() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 32
def factory_for_generating_from_hash
  ::TokyoMetro::Factory::Generate::Static::Station::InEachRailwayLine::Info
end
factory_for_generating_from_saved_files() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 24
def factory_for_generating_from_saved_files
  ::TokyoMetro::Factory::Generate::Static::Station::RailwayLines
end
factory_for_seeding_hash() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 36
def factory_for_seeding_hash
  ::TokyoMetro::Factory::Seed::Static::Station::RailwayLines
end
factory_for_seeding_info() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 44
def factory_for_seeding_info
  ::TokyoMetro::Factory::Seed::Static::Station::Info
end
factory_for_seeding_subhash() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 40
def factory_for_seeding_subhash
  ::TokyoMetro::Factory::Seed::Static::Station::InEachRailwayLine
end
hash_class() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 12
def hash_class
  ::TokyoMetro::Static::Station::RailwayLines
end
info_class() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 20
def info_class
  ::TokyoMetro::Static::Station::InEachRailwayLine::Info
end
scss_color_factory() click to toggle source

SCCS の color ファイルを作成する Factory Pattern Class の名称を返すメソッド @return [Const (class)] @note おそらく、もう使うことはない。

# File lib/tokyo_metro/class_name_library/static/station.rb, line 55
def scss_color_factory
  ::TokyoMetro::Factory::Scss::Station::Colors
end
subhash_class() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 16
def subhash_class
  ::TokyoMetro::Static::Station::InEachRailwayLine
end
title_ja() click to toggle source

タイトル @note Haml ファイルに書き出す際の見出しなどに使用 @return [String]

# File lib/tokyo_metro/class_name_library/static/station.rb, line 62
def title_ja
  "駅一覧"
end
toplevel_namespace() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 8
def toplevel_namespace
  ::TokyoMetro::Static::Station
end

Private Instance Methods

hash_for_making_file_list() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 111
def hash_for_making_file_list
  ::YAML.load_file( "#{topdir_of_station_dictionary}/file_list.yaml" )
end
subdirs_of_station_dictionary() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 127
def subdirs_of_station_dictionary
  [ "tokyo_metro" , "other_operator" , "appeared_in_connecting_railway_line_info" ]
end
topdir_of_station_dictionary() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 123
def topdir_of_station_dictionary
  "#{ ::TokyoMetro::dictionary_dir }/station"
end
yaml_files() click to toggle source

Hash のインスタンスを作成するときに必要な YAML ファイルのリスト @return [::Array <String (filename)>]

# File lib/tokyo_metro/class_name_library/static/station.rb, line 70
def yaml_files

  h = Hash.new
  hash_for_making_file_list.each do | key , value |
    h[ key ] = "#{topdir_of_station_dictionary}/#{ value.join( "\/" ) }.yaml"
  end
  h_values = h.values.sort

  files = yaml_files_in_station_dictionary_dirs

  unless h_values == files
    puts "● Hash"
    puts h_values
    puts ""
    puts "○ File"
    puts files
    puts ""
    included_in_values_of_hash = ( h_values - files )
    included_in_file_list = ( files - h_values )

    puts "※ Difference"

    if included_in_values_of_hash.present?
      puts " " * 2 + "Included in values of hash"
      included_in_values_of_hash.each do | item |
        puts " " * 2 + item
      end
    end

    if included_in_file_list.present?
      puts " " * 2 + "Included in file list"
      included_in_file_list.each do | item |
        puts " " * 2 + item
      end
    end

    raise "Error"
  end
  h
end
yaml_files_in_station_dictionary_dirs() click to toggle source
# File lib/tokyo_metro/class_name_library/static/station.rb, line 115
def yaml_files_in_station_dictionary_dirs
  subdirs_of_station_dictionary.map { | dirname |
    "#{topdir_of_station_dictionary}/#{dirname}"
  }.map { | dirname |
    Dir.glob( "#{dirname}/**/**.yaml" )
  }.flatten.sort
end