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.



115
116
117
118
# File 'lib/isono/manifest.rb', line 115

def initialize()
  super
  @desc = {}
end

Instance Attribute Details

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

#inspectObject



132
133
134
135
136
# File 'lib/isono/manifest.rb', line 132

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