Sha256: df31f79cfeafe9019b50b5d5f1439235e3c9cdd2c201e96fca8ace90c2a12a8a

Contents?: true

Size: 399 Bytes

Versions: 16

Compression:

Stored size: 399 Bytes

Contents

require 'restful/serializers/base'
require 'yajl'

#
#  AR params hash.
#
module Restful
  module Serializers
    class JsonSerializer < Base
      
      serializer_name :json
      
      def serialize(resource, options = {})
        hasher = Restful::Serializers::HashSerializer.new
        hash = hasher.serialize(resource, options)
        Yajl::Encoder.encode(hash)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
benjaminkrause-restful-0.2.8 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.1 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.10 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.11 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.12 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.13 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.14 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.15 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.2 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.3 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.4 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.5 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.6 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.7 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.8 lib/restful/serializers/json_serializer.rb
purzelrakete-restful-0.2.9 lib/restful/serializers/json_serializer.rb