class Buoys::Buoy

Attributes

context[R]
previous[R]

Public Class Methods

new(context, key, *args) click to toggle source

buoy :account do

link 'Account', account_path

end

buoy :account_edit do |account|

link 'Account Show', show_account_path(account)
link 'Account Edit', edit_account_path(account)
pre_buoy :account

end

# File lib/buoys/buoy.rb, line 15
def initialize(context, key, *args)
  block = Buoys::Loader.buoys[key]
  raise ArgumentError, "Buoys :#{key} is not found" unless block

  @key = key
  @context = context
  instance_exec(*args, &block)
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
# File lib/buoys/buoy.rb, line 43
def method_missing(method, *args, &block)
  context.send(method, *args, &block)
end
parent(key, *args)
Alias for: pre_buoy
pre_buoy(key, *args) click to toggle source
# File lib/buoys/buoy.rb, line 38
def pre_buoy(key, *args)
  @previous = Buoys::Buoy.new(context, key, *args)
end
Also aliased as: parent