Sha256: 76cb0ed0e98d0cf016960407da00333b6505a9d815ac3c2d32d483e45cbd6155

Contents?: true

Size: 517 Bytes

Versions: 4

Compression:

Stored size: 517 Bytes

Contents

module Yaks
  class Serializer
    extend Forwardable
    include Util, SharedOptions

    attr_reader :resource, :options
    def_delegators :resource, :links, :attributes, :subresources

    protected :resource, :links, :attributes, :subresources, :options

    def initialize(resource, options = {})
      @resource = resource
      @options  = YAKS_DEFAULT_OPTIONS.merge(options)
    end

    def profile_name
      (profile = resource.profile) &&
        profile_registry.find_by_uri(profile)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yaks-0.3.1 lib/yaks/serializer.rb
yaks-0.3.0 lib/yaks/serializer.rb
yaks-0.2.0 lib/yaks/serializer.rb
yaks-0.1.0 lib/yaks/serializer.rb