Class: Breadcrumb::Trail
- Inherits:
-
Struct
- Object
- Struct
- Breadcrumb::Trail
- Defined in:
- lib/breadcrumb.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#line ⇒ Object
Returns the value of attribute line.
-
#options ⇒ Object
Returns the value of attribute options.
-
#trail ⇒ Object
Returns the value of attribute trail.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
5 6 7 |
# File 'lib/breadcrumb.rb', line 5 def action @action end |
#controller ⇒ Object
Returns the value of attribute controller
5 6 7 |
# File 'lib/breadcrumb.rb', line 5 def controller @controller end |
#line ⇒ Object
Returns the value of attribute line
5 6 7 |
# File 'lib/breadcrumb.rb', line 5 def line @line end |
#options ⇒ Object
Returns the value of attribute options
5 6 7 |
# File 'lib/breadcrumb.rb', line 5 def @options end |
#trail ⇒ Object
Returns the value of attribute trail
5 6 7 |
# File 'lib/breadcrumb.rb', line 5 def trail @trail end |
Instance Method Details
#condition_met?(obj) ⇒ Boolean
6 7 8 9 10 11 12 13 14 |
# File 'lib/breadcrumb.rb', line 6 def condition_met?(obj) if [:if] evaluate(obj, [:if]) elsif [:unless] !evaluate(obj, [:unless]) else true end end |
#evaluate(obj, condition) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/breadcrumb.rb', line 16 def evaluate(obj, condition) if condition.respond_to?(:call) condition.call(obj.controller) else obj.send(condition) end end |