Class: Vagabund::Settler::Packages::Config
- Inherits:
-
Object
- Object
- Vagabund::Settler::Packages::Config
show all
- Defined in:
- lib/vagabund/settler/packages/config.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
22
23
24
|
# File 'lib/vagabund/settler/packages/config.rb', line 22
def method_missing(meth, *args, &block)
packages.send meth, *args, &block
end
|
Instance Method Details
#add_package(*args, &block) ⇒ Object
Also known as:
package, package=
10
11
12
13
14
15
16
17
18
|
# File 'lib/vagabund/settler/packages/config.rb', line 10
def add_package(*args, &block)
if args.first.is_a?(Packages::Base)
pkg = args.shift
pkg.configure &block if block_given?
packages << pkg
else
add_package Package.new(*args, &block)
end
end
|
#packages ⇒ Object
6
7
8
|
# File 'lib/vagabund/settler/packages/config.rb', line 6
def packages
@packages ||= []
end
|
#respond_to_missing?(meth, include_private = false) ⇒ Boolean
26
27
28
|
# File 'lib/vagabund/settler/packages/config.rb', line 26
def respond_to_missing?(meth, include_private=false)
packages.respond_to? meth, include_private
end
|