Class: CfnDsl::Fn

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

Overview

Handles all of the Fn

objects

Instance Method Summary collapse

Methods inherited from JSONable

#declare, #external_parameters, external_parameters

Methods included from Functions

#FnAnd, #FnBase64, #FnCidr, #FnEquals, #FnFindInMap, #FnFormat, #FnGetAZs, #FnGetAtt, #FnIf, #FnImportValue, #FnJoin, #FnNot, #FnOr, #FnSelect, #FnSplit, #FnSub, #Ref

Methods included from RefCheck

#build_references

Constructor Details

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

Returns a new instance of Fn.



212
213
214
215
216
# File 'lib/cfndsl/jsonable.rb', line 212

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

Instance Method Details

#as_json(_options = {}) ⇒ Object



218
219
220
221
222
# File 'lib/cfndsl/jsonable.rb', line 218

def as_json(_options = {})
  hash = {}
  hash["Fn::#{@function}"] = @argument
  hash
end

#ref_childrenObject



232
233
234
# File 'lib/cfndsl/jsonable.rb', line 232

def ref_children
  [@argument]
end

#referencesObject



228
229
230
# File 'lib/cfndsl/jsonable.rb', line 228

def references
  @_refs
end

#to_json(*args) ⇒ Object



224
225
226
# File 'lib/cfndsl/jsonable.rb', line 224

def to_json(*args)
  as_json.to_json(*args)
end