Class: Endeca::Refinement

Inherits:
Object show all
Includes:
Readers
Defined in:
lib/endeca/refinement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Readers

included

Constructor Details

#initialize(raw = {}) ⇒ Refinement

Returns a new instance of Refinement.



20
21
22
# File 'lib/endeca/refinement.rb', line 20

def initialize(raw={})
  @raw = raw
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



19
20
21
# File 'lib/endeca/refinement.rb', line 19

def raw
  @raw
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
# File 'lib/endeca/refinement.rb', line 24

def ==(other)
  id == other.id
end

#attributesObject



32
33
34
# File 'lib/endeca/refinement.rb', line 32

def attributes
  (@raw['Dimensions'] || []).first || {}
end

#inspectObject



28
29
30
# File 'lib/endeca/refinement.rb', line 28

def inspect
  "#<#{self.class}=0x#{self.object_id.to_s(16)} id=#{id} name=#{name.inspect}>"
end

#to_endeca_paramsObject



36
37
38
# File 'lib/endeca/refinement.rb', line 36

def to_endeca_params
  expansion_link || contraction_link
end