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, include_priv = false) ⇒ 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, #top
Constructor Details
#initialize(name, parent) ⇒ Namespace
Returns a new instance of Namespace.
171 172 173 174 |
# File 'lib/capistrano/configuration/namespaces.rb', line 171 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
184 185 186 187 188 189 190 |
# File 'lib/capistrano/configuration/namespaces.rb', line 184 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, include_priv = false) ⇒ Boolean
180 181 182 |
# File 'lib/capistrano/configuration/namespaces.rb', line 180 def respond_to?(sym, include_priv=false) super || parent.respond_to?(sym, include_priv) end |
#role(*args) ⇒ Object
176 177 178 |
# File 'lib/capistrano/configuration/namespaces.rb', line 176 def role(*args) raise NotImplementedError, "roles cannot be defined in a namespace" end |