class TokyoMetro::Factory::Generate::Static::MetaClass::Group::HashInHash
各種ハッシュを作成するための Factory クラス - 3.1 複数の YAML ファイルから、「ハッシュを値とするハッシュ」を作成
Public Class Methods
new(h)
click to toggle source
Constructor @param h [::Hash]
# File lib/tokyo_metro/factory/generate/static/meta_class/group/hash_in_hash.rb, line 6 def initialize(h) raise "Error" unless h.instance_of?( ::Hash ) @h = h end
Public Instance Methods
generating_procedure( h_new )
click to toggle source
YAML ファイルからインスタンスを生成する際のロジック @return [Hash] @note {TokyoMetro::Factory::Generate::Static::MetaClass::Group::MultipleYamls#generating_procedure} とはロジックが異なることに注意
# File lib/tokyo_metro/factory/generate/static/meta_class/group/hash_in_hash.rb, line 14 def generating_procedure( h_new ) @h.each do | key , filename | h_new[ key ] = self.class.factory_for_generating_from_each_saved_file.from_yaml( filename ) end h_new end