Method: Jsoning.generate
- Defined in:
- lib/jsoning.rb
.generate(object, options = {}) ⇒ Object
generate the json document options:
-
hash: specify if the return is a hash
-
pretty: only for when hash is set to flash, print JSON pretty
-
version: specify the version to be used for the processing
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/jsoning.rb', line 50 def generate(object, = {}) Jsoning.initialize_type_extensions protocol = protocol_for!(object.class) # use default version if version is unspecified [:version] = :default if [:version].nil? if [:hash] == true return generate_hash(object, protocol, ) else return generate_json(object, protocol, ) end end |