Class: SdlImplParam

Inherits:
Object
  • Object
show all
Defined in:
lib/tdl/sdlimplement/sdl_impl_param.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ SdlImplParam

Returns a new instance of SdlImplParam.



4
5
6
7
# File 'lib/tdl/sdlimplement/sdl_impl_param.rb', line 4

def initialize(hash)
    parse_yaml(hash['yaml'])
    parse_var(hash['var'])
end

Instance Method Details

#parse_var(var_hash) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/tdl/sdlimplement/sdl_impl_param.rb', line 18

def parse_var(var_hash)
    var_hash.each do |k,v|
        define_singleton_method(k) do
            v
        end
    end
end

#parse_yaml(yaml_hash) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/tdl/sdlimplement/sdl_impl_param.rb', line 9

def parse_yaml(yaml_hash)
    yaml_hash.each do |k,v|
        instance_variable_set("@#{k}",YAML::load(File.open(v)))
        define_singleton_method(k) do
            instance_variable_get("@#{k}")
        end
    end
end