Class: ConfigXmlClass

Inherits:
ConfigClass show all
Defined in:
lib/buzzcore/config.rb

Instance Attribute Summary collapse

Attributes inherited from ConfigClass

#default_values

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ConfigClass

#copy_booleans, #copy_floats, #copy_ints, #copy_item, #copy_strings, #read, #reset, #set_boolean, #set_float, #set_int, #set_symbol, #to_hash

Constructor Details

#initialize(aDefaultValues, aConfig) ⇒ ConfigXmlClass

Returns a new instance of ConfigXmlClass.



118
119
120
121
122
# File 'lib/buzzcore/config.rb', line 118

def initialize(aDefaultValues,aConfig)
  return super(aDefaultValues,aConfig) unless aConfig.is_a?(REXML::Element)
  @xmlRoot = aConfig.deep_clone
  super(aDefaultValues,XmlUtils.read_simple_items(@xmlRoot,'SimpleItems').symbolize_keys)
end

Instance Attribute Details

#xmlRootObject

Returns the value of attribute xmlRoot.



117
118
119
# File 'lib/buzzcore/config.rb', line 117

def xmlRoot
  @xmlRoot
end

Class Method Details

.from_file(aDefaultValues, aFile) ⇒ Object



124
125
126
127
# File 'lib/buzzcore/config.rb', line 124

def self.from_file(aDefaultValues,aFile)
  xml = XmlUtils.get_file_root(aFile)
  return ConfigXmlClass.new(aDefaultValues,xml)
end