lib/pump/encoder.rb in pump-0.7.0 vs lib/pump/encoder.rb in pump-0.8.0

- old
+ new

@@ -43,15 +43,15 @@ compile_field_map compile end - # Encode a object or an array of objects to an XML-string. + # Encode a object or an array of objects to an formatted string. # # @param [Object, Array<Object>] object object or an array of objects to - # encode to XML. The only requirement: The given objects must respond - # to all methods configured during initalization of the Pump::Xml instance. + # encode to XML or JSON. The only requirement: The given objects must respond + # to all methods configured during initalization of the Pump::Xml or Pump::JSON instance. # # @return [String] def encode(object, options={}) object = object.to_a if defined?(ActiveRecord::Relation) && object.is_a?(ActiveRecord::Relation) fields_to_hash(options) @@ -123,6 +123,6 @@ hash[name.to_s.underscore.to_sym] = true if @fields_map[name.to_s] hash end end end -end \ No newline at end of file +end