Class: Bread::CrumbToCommand

Inherits:
Object
  • Object
show all
Includes:
ActionDispatch::Routing::UrlFor
Defined in:
lib/bread/commands/crumb_to_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, key, &block) ⇒ CrumbToCommand

Returns a new instance of CrumbToCommand.



8
9
10
11
12
13
14
15
16
# File 'lib/bread/commands/crumb_to_command.rb', line 8

def initialize(controller, key, &block)
  @key = key

  IvarsCommand.new(controller).ivars.each do |key, ivar|
    instance_variable_set(key, ivar)
  end

  instance_eval(&block)
end

Instance Attribute Details

#crumbObject (readonly)

Returns the value of attribute crumb.



6
7
8
# File 'lib/bread/commands/crumb_to_command.rb', line 6

def crumb
  @crumb
end

Instance Method Details

#crumb_to(title, path, options = {}) ⇒ Object



18
19
20
# File 'lib/bread/commands/crumb_to_command.rb', line 18

def crumb_to(title, path, options={})
  @crumb = Crumb.new(options)
end