Class: Endeca::Breadcrumb
- Includes:
- Readers
- Defined in:
- lib/endeca/breadcrumb.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
(also: #attributes)
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(raw = {}) ⇒ Breadcrumb
constructor
A new instance of Breadcrumb.
- #inspect ⇒ Object
- #name ⇒ Object
Methods included from Readers
Constructor Details
#initialize(raw = {}) ⇒ Breadcrumb
Returns a new instance of Breadcrumb.
21 22 23 |
# File 'lib/endeca/breadcrumb.rb', line 21 def initialize(raw={}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly) Also known as: attributes
Returns the value of attribute raw.
20 21 22 |
# File 'lib/endeca/breadcrumb.rb', line 20 def raw @raw end |
Class Method Details
.create(raw) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/endeca/breadcrumb.rb', line 6 def self.create(raw) name = raw['Type'] = self if name unless Breadcrumbs.include?(name) raise Breadcrumbs::TypeError, "Unknown breadcrumb type: #{name.inspect}" end = Breadcrumbs[name] end .new(raw) end |
Instance Method Details
#==(other) ⇒ Object
29 30 31 |
# File 'lib/endeca/breadcrumb.rb', line 29 def ==(other) name == other.name end |
#inspect ⇒ Object
33 34 35 |
# File 'lib/endeca/breadcrumb.rb', line 33 def inspect "#<#{self.class}=0x#{self.object_id.to_s(16)} name=#{name.inspect}>" end |
#name ⇒ Object
27 |
# File 'lib/endeca/breadcrumb.rb', line 27 def name; '' end |