19
20
21
22
23
24
25
26
27
28
|
# File 'lib/json/add/rails.rb', line 19
def to_json(*a)
result = {
JSON.create_id => self.class.name
}
instance_variables.inject(result) do |r, name|
r[name[1..-1]] = instance_variable_get name
r
end
result.to_json(*a)
end
|