BasicObject
# File lib/json/add/rails.rb, line 10 def self.json_create(object) obj = new for key, value in object next if key == JSON.create_id instance_variable_set "@#{key}", value end obj end
# 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
[Validate]
Generated with the Darkfish Rdoc Generator 2.