Class: EndecaOnDemand::Response::Breadcrumb::Bread

Inherits:
Proxy
  • Object
show all
Includes:
PP
Defined in:
lib/endeca_on_demand/response/breadcrumb/bread.rb

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(breadcrumb, xml) ⇒ Bread

Returns a new instance of Bread.



14
15
16
17
18
# File 'lib/endeca_on_demand/response/breadcrumb/bread.rb', line 14

def initialize(breadcrumb, xml)
  @breadcrumb, @xml = breadcrumb, 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

fields ##



12
13
14
# File 'lib/endeca_on_demand/response/breadcrumb/bread.rb', line 12

def breadcrumb
  @breadcrumb
end

Instance Method Details

#classObject

override proxy ##



22
23
24
# File 'lib/endeca_on_demand/response/breadcrumb/bread.rb', line 22

def class
  EndecaOnDemand::Response::Breadcrumb::Bread
end

#inspect_attributesObject



8
# File 'lib/endeca_on_demand/response/breadcrumb/bread.rb', line 8

def inspect_attributes; [ :options ]; end

#optionsObject

data ##



30
31
32
33
34
35
36
# File 'lib/endeca_on_demand/response/breadcrumb/bread.rb', line 30

def options
  @options ||= xml.children.inject({}) do |hash,child|
      hash.tap do
        hash[child.name] = child.content
      end
    end.symbolize_keys
end