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.
25 26 27 |
# File 'lib/endeca/breadcrumb.rb', line 25 def initialize(raw={}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly) Also known as: attributes
Returns the value of attribute raw.
24 25 26 |
# File 'lib/endeca/breadcrumb.rb', line 24 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 |
.to_proc ⇒ Object
20 21 22 |
# File 'lib/endeca/breadcrumb.rb', line 20 def self.to_proc proc(&method(:create)) end |
Instance Method Details
#==(other) ⇒ Object
33 34 35 |
# File 'lib/endeca/breadcrumb.rb', line 33 def ==(other) name == other.name end |
#inspect ⇒ Object
37 38 39 |
# File 'lib/endeca/breadcrumb.rb', line 37 def inspect "#<#{self.class}=0x#{self.object_id.to_s(16)} name=#{name.inspect}>" end |
#name ⇒ Object
31 |
# File 'lib/endeca/breadcrumb.rb', line 31 def name; '' end |