Class: CfnDsl::Fn

Inherits:
JSONable show all
Defined in:
lib/cfndsl/JSONable.rb

Instance Method Summary collapse

Methods inherited from JSONable

#declare, #method_missing

Methods included from Functions

#FnBase64, #FnFindInMap, #FnFormat, #FnGetAZs, #FnGetAtt, #FnJoin, #Ref

Methods included from RefCheck

#references

Constructor Details

#initialize(function, argument, refs = []) ⇒ Fn

Handles all of the Fn

objects



151
152
153
154
155
# File 'lib/cfndsl/JSONable.rb', line 151

def initialize( function, argument, refs=[] )
  @function = function
  @argument = argument
  @_refs = refs
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CfnDsl::JSONable

Instance Method Details

#get_referencesObject



163
164
165
# File 'lib/cfndsl/JSONable.rb', line 163

def get_references()
  return @_refs
end

#ref_childrenObject



167
168
169
# File 'lib/cfndsl/JSONable.rb', line 167

def ref_children
  return [@argument]
end

#to_json(*a) ⇒ Object



157
158
159
160
161
# File 'lib/cfndsl/JSONable.rb', line 157

def to_json(*a)
  hash = {}
  hash["Fn::#{@function}"] = @argument
  hash.to_json(*a)
end