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.



210
211
212
213
214
# File 'lib/cfndsl/jsonable.rb', line 210

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

Instance Method Details

#as_json(_options = {}) ⇒ Object



216
217
218
219
220
# File 'lib/cfndsl/jsonable.rb', line 216

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

#ref_childrenObject



230
231
232
# File 'lib/cfndsl/jsonable.rb', line 230

def ref_children
  [@argument]
end

#referencesObject



226
227
228
# File 'lib/cfndsl/jsonable.rb', line 226

def references
  @_refs
end

#to_json(*args) ⇒ Object



222
223
224
# File 'lib/cfndsl/jsonable.rb', line 222

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