Class: CfnDsl::Fn
Overview
- Handles all of the Fn
-
objects
Instance Method Summary collapse
- #as_json(_options = {}) ⇒ Object
-
#initialize(function, argument, refs = []) ⇒ Fn
constructor
A new instance of Fn.
- #ref_children ⇒ Object
- #references ⇒ Object
- #to_json(*a) ⇒ Object
Methods inherited from JSONable
#declare, #external_parameters, external_parameters, #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
Constructor Details
#initialize(function, argument, refs = []) ⇒ Fn
Returns a new instance of Fn.
196 197 198 199 200 |
# File 'lib/cfndsl/jsonable.rb', line 196 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
#as_json(_options = {}) ⇒ Object
202 203 204 205 206 |
# File 'lib/cfndsl/jsonable.rb', line 202 def as_json( = {}) hash = {} hash["Fn::#{@function}"] = @argument hash end |
#ref_children ⇒ Object
216 217 218 |
# File 'lib/cfndsl/jsonable.rb', line 216 def ref_children [@argument] end |
#references ⇒ Object
212 213 214 |
# File 'lib/cfndsl/jsonable.rb', line 212 def references @_refs end |
#to_json(*a) ⇒ Object
208 209 210 |
# File 'lib/cfndsl/jsonable.rb', line 208 def to_json(*a) as_json.to_json(*a) end |