Parent

Files

Class/Module Index [+]

Quicksearch

Capistrano::Configuration::Namespaces::Namespace

Public Class Methods

new(name, parent) click to toggle source
# File lib/capistrano/configuration/namespaces.rb, line 176
def initialize(name, parent)
  @parent = parent
  @name = name
  
  explicitly_define_clashing_kernel_methods
end

Public Instance Methods

method_missing(sym, *args, &block) click to toggle source
# File lib/capistrano/configuration/namespaces.rb, line 191
def method_missing(sym, *args, &block)
  if parent.respond_to?(sym)
    parent.send(sym, *args, &block)
  else
    super
  end
end
respond_to?(sym, include_priv=false) click to toggle source
# File lib/capistrano/configuration/namespaces.rb, line 187
def respond_to?(sym, include_priv=false)
  super || parent.respond_to?(sym, include_priv)
end
role(*args) click to toggle source
# File lib/capistrano/configuration/namespaces.rb, line 183
def role(*args)
  raise NotImplementedError, "roles cannot be defined in a namespace"
end

Protected Instance Methods

explicitly_define_clashing_kernel_methods() click to toggle source
# File lib/capistrano/configuration/namespaces.rb, line 204
def explicitly_define_clashing_kernel_methods
  (parent.public_methods & Kernel.methods).each do |m|
    next if self.method(m).owner == self.class
    if parent.method(m).owner == parent.class
      metaclass = class << self; self; end
      metaclass.send(:define_method, m) {|*args, &block| parent.send(m, *args, &block)}
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.