Class: Bread::Crumb
- Inherits:
- 
      Hash
      
        - Object
- Hash
- Bread::Crumb
 
- Defined in:
- lib/bread/data/crumb.rb
Instance Method Summary collapse
- #current? ⇒ Boolean
- #first? ⇒ Boolean
- 
  
    
      #initialize(controller, title, path, options)  ⇒ Crumb 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Crumb. 
- #last? ⇒ Boolean
- #path ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(controller, title, path, options) ⇒ Crumb
| 4 5 6 7 8 9 | # File 'lib/bread/data/crumb.rb', line 4 def initialize(controller, title, path, ) self.controller = controller .merge(title: title, path: path).each do |k, v| self[k] = v end end | 
Instance Method Details
#current? ⇒ Boolean
| 27 28 29 | # File 'lib/bread/data/crumb.rb', line 27 def current? controller.view_context.current_page? path end | 
#first? ⇒ Boolean
| 19 20 21 | # File 'lib/bread/data/crumb.rb', line 19 def first? self[:_first] end | 
#last? ⇒ Boolean
| 23 24 25 | # File 'lib/bread/data/crumb.rb', line 23 def last? self[:_last] end | 
#path ⇒ Object
| 15 16 17 | # File 'lib/bread/data/crumb.rb', line 15 def path self[:path] end | 
#title ⇒ Object
| 11 12 13 | # File 'lib/bread/data/crumb.rb', line 11 def title self[:title] end |