Class: Struct
- Inherits:
-
Object
- Object
- Struct
- Defined in:
- lib/klipbook/util/struct_to_json.rb
Instance Method Summary collapse
Instance Method Details
permalink #to_json(*a) ⇒ Object
[View source]
8 9 10 |
# File 'lib/klipbook/util/struct_to_json.rb', line 8 def to_json(*a) to_map.to_json(*a) end |
permalink #to_map ⇒ Object
[View source]
2 3 4 5 6 |
# File 'lib/klipbook/util/struct_to_json.rb', line 2 def to_map map = Hash.new self.members.each { |m| map[m] = self[m] } map end |