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, #FnEquals, #FnFindInMap, #FnFormat, #FnGetAZs, #FnGetAtt, #FnIf, #FnJoin, #FnNot, #FnOr, #FnSelect, #Ref

Methods included from RefCheck

#build_references

Constructor Details

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

Returns a new instance of Fn.



179
180
181
182
183
# File 'lib/cfndsl/jsonable.rb', line 179

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

Instance Method Details

#as_json(_options = {}) ⇒ Object



185
186
187
188
189
# File 'lib/cfndsl/jsonable.rb', line 185

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

#ref_childrenObject



199
200
201
# File 'lib/cfndsl/jsonable.rb', line 199

def ref_children
  [@argument]
end

#referencesObject



195
196
197
# File 'lib/cfndsl/jsonable.rb', line 195

def references
  @_refs
end

#to_json(*a) ⇒ Object



191
192
193
# File 'lib/cfndsl/jsonable.rb', line 191

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