Class: EndecaOnDemand::Response::Property

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

Instance Attribute Summary collapse

Attributes inherited from Proxy

#xml

Instance Method Summary collapse

Methods included from PP

#pretty_print

Constructor Details

#initialize(parent, xml) ⇒ Property

Returns a new instance of Property


15
16
17
# File 'lib/endeca_on_demand/response/property.rb', line 15

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


13
14
15
# File 'lib/endeca_on_demand/response/property.rb', line 13

def parent
  @parent
end

Instance Method Details

#classObject

override proxy ##


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

def class
  EndecaOnDemand::Response::Property
end

#inspectObject


9
# File 'lib/endeca_on_demand/response/property.rb', line 9

def inspect; "#{label}: #{value.inspect}"; end

#inspect_attributesObject


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

def inspect_attributes; [ :label, :value ]; end

#labelObject

data ##


29
30
31
# File 'lib/endeca_on_demand/response/property.rb', line 29

def label
  xml.name.to_s.gsub(/^p_/, '')
end

#valueObject Also known as: to_s, to_param


33
34
35
# File 'lib/endeca_on_demand/response/property.rb', line 33

def value
  xml.content
end