Class: Symbol

Inherits:
Object show all
Defined in:
lib/json/add/core.rb,
lib/json/add/rails.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.json_create(o) ⇒ Object



18
19
20
# File 'lib/json/add/core.rb', line 18

def self.json_create(o)
  o['s'].to_sym
end

Instance Method Details

#to_json(*a) ⇒ Object



11
12
13
14
15
16
# File 'lib/json/add/core.rb', line 11

def to_json(*a)
  {
    JSON.create_id => self.class.name,
    's' => to_s,
  }.to_json(*a)
end