class Ahora::Representation

Constants

BOOL_PARSER
DATE_PARSER
FLOAT_PARSER
INTEGER_PARSER
STRING_PARSER
TIME_PARSER

Public Class Methods

new(doc_or_atts = {}) click to toggle source
Calls superclass method
# File lib/ahora/representation.rb, line 82
def initialize(doc_or_atts = {})
  if doc_or_atts.is_a? Hash
    super("")
    doc_or_atts.each do |key, val|
      send("#{key}=", val)
    end
  else
    doc = doc_or_atts
    doc = XmlParser.parse(doc) unless doc.respond_to?(:search)
    if doc.node_type == Nokogiri::XML::Node::DOCUMENT_NODE
      # immediately scope to root element
      doc = doc.at('/*')
    end
    super(doc)
  end
end