Class: Crumby::Entry
- Inherits:
-
Struct
- Object
- Struct
- Crumby::Entry
- Defined in:
- lib/crumby/entry.rb
Overview
represent an entry of a breadcrumb menu
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#options ⇒ Object
Returns the value of attribute options.
-
#position ⇒ Object
Returns the value of attribute position.
-
#route ⇒ Object
Returns the value of attribute route.
-
#trail ⇒ Object
Returns the value of attribute trail.
Instance Method Summary collapse
-
#first? ⇒ Boolean
Returns if first entry.
-
#last? ⇒ Boolean
Returns if last entry.
-
#total ⇒ Fixnum
Returns total entries.
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label
5 6 7 |
# File 'lib/crumby/entry.rb', line 5 def label @label end |
#options ⇒ Object
Returns the value of attribute options
5 6 7 |
# File 'lib/crumby/entry.rb', line 5 def @options end |
#position ⇒ Object
Returns the value of attribute position
5 6 7 |
# File 'lib/crumby/entry.rb', line 5 def position @position end |
#route ⇒ Object
Returns the value of attribute route
5 6 7 |
# File 'lib/crumby/entry.rb', line 5 def route @route end |
#trail ⇒ Object
Returns the value of attribute trail
5 6 7 |
# File 'lib/crumby/entry.rb', line 5 def trail @trail end |
Instance Method Details
#first? ⇒ Boolean
Returns if first entry
15 16 17 |
# File 'lib/crumby/entry.rb', line 15 def first? position.zero? end |
#last? ⇒ Boolean
Returns if last entry
21 22 23 |
# File 'lib/crumby/entry.rb', line 21 def last? (total - position - 1).zero? end |
#total ⇒ Fixnum
Returns total entries
9 10 11 |
# File 'lib/crumby/entry.rb', line 9 def total trail.count end |