Class: Struct
Direct Known Subclasses
Instance Method Summary collapse
-
#to_hash ⇒ Object
Transform this struct into a JSON hash.
-
#to_json(*args) ⇒ Object
Transform the struct into a simple JSON hash.
Instance Method Details
#to_hash ⇒ Object
Transform this struct into a JSON hash
177 178 179 180 181 |
# File 'lib/epitools/core_ext/misc.rb', line 177 def to_hash hash = {} each_pair { |k,v| hash[k] = v } hash end |
#to_json(*args) ⇒ Object
Transform the struct into a simple JSON hash.
186 187 188 |
# File 'lib/epitools/core_ext/misc.rb', line 186 def to_json(*args) to_hash.to_json end |