class TokyoMetro::Factory::Generate::Static::Operator::Info

Public Class Methods

hash_keys() click to toggle source
# File lib/tokyo_metro/factory/generate/static/operator/info.rb, line 5
def self.hash_keys
  [
    :name_ja , :name_ja_display , :name_en , :name_en_display , :index ,
    :operator_code , :numbering ,
    :railway_line_code_shape , :station_code_shape , :color ,
    :twitter_widget_id , :twitter_account_name
  ]
end

Private Instance Methods

has_color?() click to toggle source
# File lib/tokyo_metro/factory/generate/static/operator/info.rb, line 33
def has_color?
  @hash_for_making_variables[ :color ].present?
end
has_no_railway_line_code?() click to toggle source
# File lib/tokyo_metro/factory/generate/static/operator/info.rb, line 45
def has_no_railway_line_code?
  @hash_for_making_variables[ :railway_line_code_shape ] == "none"
end
has_no_station_code?() click to toggle source
# File lib/tokyo_metro/factory/generate/static/operator/info.rb, line 49
def has_no_station_code?
  @hash_for_making_variables[ :station_code_shape ] == "none"
end
has_number?() click to toggle source
# File lib/tokyo_metro/factory/generate/static/operator/info.rb, line 37
def has_number?
  @hash_for_making_variables[ :numbering ]
end
has_railway_line_code?() click to toggle source
# File lib/tokyo_metro/factory/generate/static/operator/info.rb, line 41
def has_railway_line_code?
  @hash_for_making_variables[ :railway_line_code_shape ].present?
end
set_values_to_hash_for_making_variables() click to toggle source
# File lib/tokyo_metro/factory/generate/static/operator/info.rb, line 16
def set_values_to_hash_for_making_variables
  super( hash_key_array: [ :name_ja , :name_en ] , make_array: true )
  super( hash_key_array: [ :name_ja_display , :name_en_display , :index , :operator_code , :railway_line_code_shape , :station_code_shape , :color ] )
  super( hash_key_array: [ :twitter_widget_id , :twitter_account_name ] )
  super( hash_key_array: :numbering , boolean: true )

  unless has_color?
    raise "Error"
  end

  @hash_for_making_variables[ :color ] = ::TokyoMetro::Static::Color::generate_from_hash( @h[ :color ] )

  if has_number? and !( has_railway_line_code? ) and has_no_station_code?
    @hash_for_making_variables[ :railway_line_code_shape ] = "none"
  end
end