Class: EndecaOnDemand::Response::KeywordRedirect

Inherits:
Proxy
  • Object
show all
Includes:
PP
Defined in:
lib/endeca_on_demand/response/keyword_redirect.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(response, xml) ⇒ KeywordRedirect

Returns a new instance of KeywordRedirect



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

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

#responseObject (readonly)

fields ##



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

def response
  @response
end

Instance Method Details

#classObject

override proxy ##



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

def class
  EndecaOnDemand::Response::KeywordRedirect
end

#inspect_attributesObject



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

def inspect_attributes; [ :options ]; end

#optionsObject

data ##



29
30
31
32
33
34
35
# File 'lib/endeca_on_demand/response/keyword_redirect.rb', line 29

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