Class: EndecaOnDemand::Response::RecordsSet

Inherits:
Proxy
  • Object
show all
Includes:
PP
Defined in:
lib/endeca_on_demand/response/records_set.rb,
lib/endeca_on_demand/response/records_set/record.rb

Defined Under Namespace

Classes: Record

Instance Attribute Summary collapse

Attributes inherited from Proxy

#xml

Instance Method Summary collapse

Methods included from PP

#inspect, #pretty_print

Methods inherited from Proxy

#inspect

Constructor Details

#initialize(parent, xml) ⇒ RecordsSet

Returns a new instance of RecordsSet.



13
14
15
16
17
# File 'lib/endeca_on_demand/response/records_set.rb', line 13

def initialize(parent, xml)
  @parent, @xml = parent, xml

  define_getters(:options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EndecaOnDemand::Proxy

Instance Attribute Details

#parentObject (readonly)

fields ##



11
12
13
# File 'lib/endeca_on_demand/response/records_set.rb', line 11

def parent
  @parent
end

#recordsObject (readonly)

associations ##



11
12
13
# File 'lib/endeca_on_demand/response/records_set.rb', line 11

def records
  @records
end

Instance Method Details

#classObject

override proxy ##



21
22
23
# File 'lib/endeca_on_demand/response/records_set.rb', line 21

def class
  EndecaOnDemand::Response::RecordsSet
end

#inspect_attributesObject



7
# File 'lib/endeca_on_demand/response/records_set.rb', line 7

def inspect_attributes; [ :options, :records ]; end

#optionsObject

data ##



37
38
39
40
41
42
43
# File 'lib/endeca_on_demand/response/records_set.rb', line 37

def options
  @options ||= xml.xpath('child::node()[not(local-name() = "Record")]').inject({}) do |hash,child|
      hash.tap do
        hash[child.name] = child.content
      end
    end.symbolize_keys
end