Class: DNZ::Result

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/dnz/result.rb

Overview

A DNZ::Search result record

Instance Method Summary collapse

Methods included from Attributes

#method_missing

Constructor Details

#initialize(doc) ⇒ Result

Returns a new instance of Result.



8
9
10
11
12
13
14
# File 'lib/dnz/result.rb', line 8

def initialize(doc)
  @attributes = {}

  doc.children.each do |child|
    @attributes[child.name.downcase.underscore] = child.text.to_s
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DNZ::Attributes