Module: RestfulX::ActiveRecord::InstanceMethods
- Defined in:
- lib/restfulx/rx_active_record.rb
Instance Method Summary collapse
-
#to_amf(options = {}) ⇒ Object
serialize this model as AMF.
-
#to_fxml(options = {}) ⇒ Object
serialize this model as fXML.
- #unique_id ⇒ Object
Instance Method Details
#to_amf(options = {}) ⇒ Object
serialize this model as AMF
273 274 275 276 277 278 |
# File 'lib/restfulx/rx_active_record.rb', line 273 def to_amf( = {}) default_except = [:crypted_password, :salt, :remember_token, :remember_token_expires_at, :created_at, :updated_at] [:except] = ([:except] ? [:except] + default_except : default_except) RestfulX::Serialization::AMFSerializer.new(self, ).to_s end |
#to_fxml(options = {}) ⇒ Object
serialize this model as fXML
281 282 283 284 285 286 287 |
# File 'lib/restfulx/rx_active_record.rb', line 281 def to_fxml( = {}) .merge!(:dasherize => false) default_except = [:crypted_password, :salt, :remember_token, :remember_token_expires_at, :created_at, :updated_at] [:except] = ([:except] ? [:except] + default_except : default_except) RestfulX::Serialization::FXMLSerializer.new(self, ).to_s end |
#unique_id ⇒ Object
268 269 270 |
# File 'lib/restfulx/rx_active_record.rb', line 268 def unique_id "#{self.class.to_s}_#{self.attributes()['id']}" end |