Class: Struct
- Inherits:
-
Object
- Object
- Struct
- Defined in:
- lib/cloudformation-ruby-dsl/cfntemplate.rb
Overview
utility class to deserialize Structs as JSON borrowed from ruhe.tumblr.com/post/565540643/generate-json-from-ruby-struct
Instance Method Summary collapse
Instance Method Details
#to_json(*a) ⇒ Object
79 80 81 |
# File 'lib/cloudformation-ruby-dsl/cfntemplate.rb', line 79 def to_json(*a) to_map.to_json(*a) end |
#to_map ⇒ Object
73 74 75 76 77 |
# File 'lib/cloudformation-ruby-dsl/cfntemplate.rb', line 73 def to_map map = Hash.new self.members.each { |m| map[m] = self[m] } map end |