Parent

Files

Symbol

Symbol serialization/deserialization

Public Class Methods

json_create(o) click to toggle source

Deserializes JSON string by converting the string value stored in the object to a Symbol

    # File lib/json/add/symbol.rb, line 22
22:   def self.json_create(o)
23:     o['s'].to_sym
24:   end

Public Instance Methods

as_json(*) click to toggle source

Returns a hash, that will be turned into a JSON object and represent this object.

    # File lib/json/add/symbol.rb, line 9
 9:   def as_json(*)
10:     {
11:       JSON.create_id => self.class.name,
12:       's'            => to_s,
13:     }
14:   end
to_json(*a) click to toggle source

Stores class name (Symbol) with String representation of Symbol as a JSON string.

    # File lib/json/add/symbol.rb, line 17
17:   def to_json(*a)
18:     as_json.to_json(*a)
19:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.