Class: Isono::Manifest::ConfigStruct
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Isono::Manifest::ConfigStruct
- Defined in:
- lib/isono/manifest.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
Instance Method Summary collapse
-
#add_section(name) ⇒ Object
create sub config tree.
-
#initialize ⇒ ConfigStruct
constructor
A new instance of ConfigStruct.
- #inspect ⇒ Object
Constructor Details
#initialize ⇒ ConfigStruct
Returns a new instance of ConfigStruct.
115 116 117 118 |
# File 'lib/isono/manifest.rb', line 115 def initialize() super @desc = {} end |
Instance Attribute Details
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
113 114 115 |
# File 'lib/isono/manifest.rb', line 113 def desc @desc end |
Instance Method Details
#add_section(name) ⇒ Object
create sub config tree
121 122 123 124 125 126 127 128 129 130 |
# File 'lib/isono/manifest.rb', line 121 def add_section(name) newsec = self.class.new self.instance_eval %Q" def #{name}(&blk) blk.call(self) if blk @table[:#{name}] end " @table[name.to_sym] = newsec end |
#inspect ⇒ Object
132 133 134 135 136 |
# File 'lib/isono/manifest.rb', line 132 def inspect @table.keys.map { |k| "#{k}=#{@table[k]}" }.join(', ') end |