Class: PoolParty::Base

Inherits:
Object show all
Includes:
Dslify
Defined in:
lib/poolparty/base.rb

Direct Known Subclasses

Chef, ChefAttribute, Cloud, Pool

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, o = {}, &block) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
15
# File 'lib/poolparty/base.rb', line 9

def initialize(name, o={}, &block)
  @name = name
  @init_opts = o
  set_vars_from_options(o)
  instance_eval &block if block
  after_initialized
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *a, &block) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/poolparty/base.rb', line 21

def method_missing(m,*a,&block)
  if parent.respond_to?(m)
    parent.send(m,*a,&block)
  else
    super
  end
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/poolparty/base.rb', line 8

def name
  @name
end

Instance Method Details

#after_initializedObject



16
17
# File 'lib/poolparty/base.rb', line 16

def after_initialized
end

#runObject



18
19
20
# File 'lib/poolparty/base.rb', line 18

def run
  warn "#{self.class} does not implement run. Something is wrong"
end