Sha256: f083054445b28efcc77b855fa29e46451b4ba0f8b75e9d9c5dfb64ec7d5321aa

Contents?: true

Size: 556 Bytes

Versions: 6

Compression:

Stored size: 556 Bytes

Contents

module Bread
  class Crumb < Hash

    def initialize(controller, title, path, options)
      self.controller = controller
      options.merge(title: title, path: path).each do |k, v|
        self[k] = v
      end
    end

    def title
      self[:title]
    end

    def path
      self[:path]
    end

    def first?
      self[:_first]
    end

    def last?
      self[:_last]
    end

    def current?
      controller.view_context.current_page? path
    end

    private

    attr_accessor :controller

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bread-0.0.13 lib/bread/data/crumb.rb
bread-0.0.12 lib/bread/data/crumb.rb
bread-0.0.11 lib/bread/data/crumb.rb
bread-0.0.10 lib/bread/data/crumb.rb
bread-0.0.9 lib/bread/data/crumb.rb
bread-0.0.7 lib/bread/data/crumb.rb