Class: Isono::Manifest::ConfigStruct

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/isono/manifest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfigStruct

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

#descObject (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

#inspectObject



123
124
125
126
127
# File 'lib/isono/manifest.rb', line 123

def inspect
  @table.keys.map { |k|
    "#{k}=#{@table[k]}"
  }.join(', ')
end