Class: Isono::Manifest::ConfigStructBuilder
- Inherits:
-
Object
- Object
- Isono::Manifest::ConfigStructBuilder
show all
- Defined in:
- lib/isono/manifest.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ConfigStructBuilder.
142
143
144
145
|
# File 'lib/isono/manifest.rb', line 142
def initialize(config)
@cur_desc=nil
@config = config
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
158
159
160
161
162
163
164
165
|
# File 'lib/isono/manifest.rb', line 158
def method_missing(name, *args)
return if name.to_sym == :add_config
if name.to_s =~ /=$/
add_config(name.to_s.sub(/=$/,''), args[0])
else
add_config(name, *args)
end
end
|
Instance Method Details
#add_config(name, default_val = nil) ⇒ Object
147
148
149
150
151
152
|
# File 'lib/isono/manifest.rb', line 147
def add_config(name, default_val=nil)
@config.send("#{name}=".to_sym, default_val)
@config.desc[name.to_sym] = @cur_desc
@cur_desc = nil
end
|
#desc(desc) ⇒ Object
154
155
156
|
# File 'lib/isono/manifest.rb', line 154
def desc(desc)
@cur_desc = desc
end
|