Module: Jinx::Collection
- Defined in:
- lib/jinx/json/collection.rb
Instance Method Summary collapse
-
#to_json(state = nil) ⇒ String
Adds JSON serialization to collections.
Instance Method Details
#to_json(state = nil) ⇒ String
Adds JSON serialization to collections.
10 11 12 13 14 |
# File 'lib/jinx/json/collection.rb', line 10 def to_json(state=nil) # Make a new State from the options if this is a top-level call. state = JSON::State.for(state) unless JSON::State === state to_a.to_json(state) end |