Class: Cloudruler::Ruler::Content::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudruler/ruler/content/base.rb

Direct Known Subclasses

Conditions, Mappings, Metadata, Outputs, Resources, Transform

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ruler, annotations, content_hash, options) ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
12
# File 'lib/cloudruler/ruler/content/base.rb', line 7

def initialize(ruler, annotations, content_hash, options)
  @ruler = ruler
  @content_hash = content_hash
  @annotations = annotations
  @name_suffix = options[:resource_name_suffix]
end

Instance Attribute Details

#rulerObject (readonly)

Returns the value of attribute ruler.



5
6
7
# File 'lib/cloudruler/ruler/content/base.rb', line 5

def ruler
  @ruler
end

Instance Method Details

#build_name(name) ⇒ Object



20
21
22
# File 'lib/cloudruler/ruler/content/base.rb', line 20

def build_name(name)
  name
end

#contentObject



14
15
16
17
18
# File 'lib/cloudruler/ruler/content/base.rb', line 14

def content
  @content ||= @content_hash.each_with_object({}) do |(k, v), obj|
    obj[build_name(k)] = v
  end
end