Methods
Public Instance methods
Returns an Array of attribute names of the model
[ show source ]
# File lib/twitter/rails.rb, line 45
45: def attribute_names
46: self.class.class_eval("@@ATTRIBUTES").collect {|att| att.to_s }
47: end
Returns JSON representation of model.
The current implementation basically ignoring options, so reopen and override this implementation or live with it for the moment:)
[ show source ]
# File lib/twitter/rails.rb, line 63
63: def to_json(options = {})
64: JSON.unparse(self.to_hash)
65: end
Override default +to_param+ implementation.
[ show source ]
# File lib/twitter/rails.rb, line 50
50: def to_param
51: self.id.to_s
52: end
Returns XML representation of model.
[ show source ]
# File lib/twitter/rails.rb, line 55
55: def to_xml(options = {})
56: ActiveRecord::XmlSerializer.new(self, options.merge(:root => self.class.name.xmlize)).to_s
57: end