Class: CloudBuilder::JSONable
- Inherits:
-
Object
- Object
- CloudBuilder::JSONable
- Defined in:
- lib/cloud_builder/jsonable.rb
Instance Method Summary collapse
Instance Method Details
#to_hash ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/cloud_builder/jsonable.rb', line 3 def to_hash hash = {} self.instance_variables.each do |var| hash[var.to_s.delete("@")] = self.instance_variable_get var end hash end |
#to_json(*a) ⇒ Object
12 13 14 |
# File 'lib/cloud_builder/jsonable.rb', line 12 def to_json(*a) self.to_hash.to_json(*a) end |