Class: Seiun::XMLParsers::RecordXML

Inherits:
Base
  • Object
show all
Defined in:
lib/seiun/xml_parsers/record_xml.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Seiun::XMLParsers::Base

Class Method Details

.each(xml_str, find_tag: "records", &block) ⇒ Object



5
6
7
# File 'lib/seiun/xml_parsers/record_xml.rb', line 5

def each(xml_str, find_tag: "records", &block)
  parse(xml_str, find_tag, block)
end

Instance Method Details

#to_hash(strict_mode = false) ⇒ Object



10
11
12
13
14
15
# File 'lib/seiun/xml_parsers/record_xml.rb', line 10

def to_hash(strict_mode = false)
  source = super
  source.keys.find_all{|key| key =~ /(^[A-Z]|__c$)/ }.each_with_object({}) do |key, hash|
    hash[key] = source[key]
  end
end