Class: Capistrano::Configuration::Namespaces::Namespace
- Inherits:
-
Object
- Object
- Capistrano::Configuration::Namespaces::Namespace
- Includes:
- Capistrano::Configuration::Namespaces
- Defined in:
- lib/capistrano/configuration/namespaces.rb
Constant Summary
Constants included from Capistrano::Configuration::Namespaces
Instance Attribute Summary
Attributes included from Capistrano::Configuration::Namespaces
#name, #namespaces, #parent, #tasks
Instance Method Summary collapse
-
#initialize(name, parent) ⇒ Namespace
constructor
A new instance of Namespace.
- #method_missing(sym, *args, &block) ⇒ Object
- #respond_to?(sym) ⇒ Boolean
- #role(*args) ⇒ Object
Methods included from Capistrano::Configuration::Namespaces
#default_task, #desc, #find_task, #fully_qualified_name, included, #namespace, #next_description, #search_task, #task, #task_list
Constructor Details
#initialize(name, parent) ⇒ Namespace
Returns a new instance of Namespace.
164 165 166 167 |
# File 'lib/capistrano/configuration/namespaces.rb', line 164 def initialize(name, parent) @parent = parent @name = name end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
177 178 179 180 181 182 183 |
# File 'lib/capistrano/configuration/namespaces.rb', line 177 def method_missing(sym, *args, &block) if parent.respond_to?(sym) parent.send(sym, *args, &block) else super end end |
Instance Method Details
#respond_to?(sym) ⇒ Boolean
173 174 175 |
# File 'lib/capistrano/configuration/namespaces.rb', line 173 def respond_to?(sym) super || parent.respond_to?(sym) end |
#role(*args) ⇒ Object
169 170 171 |
# File 'lib/capistrano/configuration/namespaces.rb', line 169 def role(*args) raise NotImplementedError, "roles cannot be defined in a namespace" end |