Class: CloudFormation::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud_formation/base.rb

Direct Known Subclasses

DynamoDB, Template

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attribute_list(*attrs) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/cloud_formation/base.rb', line 3

def self.attribute_list *attrs
  attrs.each do |name|
    define_method "#{name}=".to_sym do |value|
      instance_variable_set "@#{name}", value
    end
    define_method name.to_sym do
      instance_variable_get "@#{name}"
    end
  end
  define_method :attributes do
    attrs
  end
end

Instance Method Details

#build {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



17
18
19
# File 'lib/cloud_formation/base.rb', line 17

def build &block
  yield self
end