class EOAT::Result::EveType::Row
Key-values container. All methods generated automatically.
Public Class Methods
new(hash)
click to toggle source
@param [Hash] hash the xml row value from xml as hash
# File lib/eoat/result/eve_type.rb, line 173 def initialize(hash) hash.each do |key, value| case value when Hash if value.key? 'row' var_name = value['name'] var_value = RowSet.new(value) else var_name = key var_value = Row.new(value) end self.instance_variable_set("@#{var_name}",var_value) self.class.send( :define_method, var_name, proc { self.instance_variable_get("@#{var_name}") } ) when String, NilClass self.instance_variable_set("@#{key}", value) self.class.send( :define_method, key, proc { self.instance_variable_get("@#{key}") } ) when Array value.each do |element| self.instance_variable_set("@#{element['name']}", RowSet.new(element)) self.class.send( :define_method, element['name'], proc { self.instance_variable_get("@#{element['name']}") } ) end else raise EOAT::Exception::ParseError.new "Unable to parse the the key: #{key}, value: #{value.class}; hash: #{hash}." end end end
Public Instance Methods
method_missing(meth, *args, &block)
click to toggle source
Calls superclass method
# File lib/eoat/result/eve_type.rb, line 218 def method_missing(meth, *args, &block) if instance_variable_defined?("@#{meth.to_s}") instance_variable_get("@#{meth.to_s}") else super end end
respond_to?(meth)
click to toggle source
Calls superclass method
# File lib/eoat/result/eve_type.rb, line 226 def respond_to?(meth) if instance_variable_defined?("@#{meth.to_s}") true else super end end