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

#FnAnd, #FnBase64, #FnEquals, #FnFindInMap, #FnFormat, #FnGetAZs, #FnGetAtt, #FnIf, #FnJoin, #FnNot, #FnOr, #FnSelect, #Ref

Methods included from RefCheck

#references

Constructor Details

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

Handles all of the Fn

objects



193
194
195
196
197
# File 'lib/cfndsl/JSONable.rb', line 193

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



205
206
207
# File 'lib/cfndsl/JSONable.rb', line 205

def get_references()
  return @_refs
end

#ref_childrenObject



209
210
211
# File 'lib/cfndsl/JSONable.rb', line 209

def ref_children
  return [@argument]
end

#to_json(*a) ⇒ Object



199
200
201
202
203
# File 'lib/cfndsl/JSONable.rb', line 199

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