Method: ActiveResource::Base#encode

Defined in:
lib/active_resource/base.rb

#encode(options = {}) ⇒ Object

Returns the serialized string representation of the resource in the configured serialization format specified in ActiveResource::Base.format. The options applicable depend on the configured encoding format.



970
971
972
973
974
975
976
977
# File 'lib/active_resource/base.rb', line 970

def encode(options={})
  case self.class.format
    when ActiveResource::Formats[:xml]
      self.class.format.encode(attributes, {:root => self.class.element_name}.merge(options))
    else
      self.class.format.encode(attributes, options)
  end
end