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, #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.



205
206
207
208
209
# File 'lib/cfndsl/jsonable.rb', line 205

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

Instance Method Details

#as_json(_options = {}) ⇒ Object



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

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

#ref_childrenObject



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

def ref_children
  [@argument]
end

#referencesObject



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

def references
  @_refs
end

#to_json(*a) ⇒ Object



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

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