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.
106 107 108 109 |
# File 'lib/isono/manifest.rb', line 106 def initialize() super @desc = {} end |
Instance Attribute Details
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
104 105 106 |
# File 'lib/isono/manifest.rb', line 104 def desc @desc end |
Instance Method Details
#add_section(name) ⇒ Object
create sub config tree
112 113 114 115 116 117 118 119 120 121 |
# File 'lib/isono/manifest.rb', line 112 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
123 124 125 126 127 |
# File 'lib/isono/manifest.rb', line 123 def inspect @table.keys.map { |k| "#{k}=#{@table[k]}" }.join(', ') end |