Class: CfnDsl::Fn

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

Instance Method Summary collapse

Methods inherited from JSONable

#declare, #incorrect_capitalization?, #method_missing, #titleize

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


202
203
204
205
206
# File 'lib/cfndsl/JSONable.rb', line 202

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


214
215
216
# File 'lib/cfndsl/JSONable.rb', line 214

def get_references()
  return @_refs
end

#ref_childrenObject


218
219
220
# File 'lib/cfndsl/JSONable.rb', line 218

def ref_children
  return [@argument]
end

#to_json(*a) ⇒ Object


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

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