Sha256: 6e03ae4966c66d08ca911ff12ad6ed23150ec7465ae1cdd9e05ac59166b5c325

Contents?: true

Size: 688 Bytes

Versions: 14

Compression:

Stored size: 688 Bytes

Contents

module Shamu
  module JsonApi

    # Used by a {Serilaizer} to write fields and relationships
    class BaseBuilder

      # @param [Context] context the current serialization context.
      def initialize( context )
        @context = context
        @output = {}
      end

      include BuilderMethods::Link
      include BuilderMethods::Meta

      # @return [Hash] the results output as JSON safe hash.
      def compile
        output
      end

      private

        # @!attribute
        # @return [Hash] output hash.
          attr_reader :output

        # @!attribute
        # @return [Context] the JSON serialization context.
          attr_reader :context
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
shamu-0.0.24 lib/shamu/json_api/base_builder.rb
shamu-0.0.21 lib/shamu/json_api/base_builder.rb
shamu-0.0.20 lib/shamu/json_api/base_builder.rb
shamu-0.0.19 lib/shamu/json_api/base_builder.rb
shamu-0.0.18 lib/shamu/json_api/base_builder.rb
shamu-0.0.17 lib/shamu/json_api/base_builder.rb
shamu-0.0.15 lib/shamu/json_api/base_builder.rb
shamu-0.0.14 lib/shamu/json_api/base_builder.rb
shamu-0.0.13 lib/shamu/json_api/base_builder.rb
shamu-0.0.11 lib/shamu/json_api/base_builder.rb
shamu-0.0.9 lib/shamu/json_api/base_builder.rb
shamu-0.0.8 lib/shamu/json_api/base_builder.rb
shamu-0.0.7 lib/shamu/json_api/base_builder.rb
shamu-0.0.5 lib/shamu/json_api/base_builder.rb