Sha256: d8ed9e609889987a4fa747e835baed56e379edf4f0a5055be2cfaf7e167ef358

Contents?: true

Size: 441 Bytes

Versions: 5

Compression:

Stored size: 441 Bytes

Contents

module Shogun
  class Presenters
    def initialize(resources:, cast:, meta: {}, links: {}, linked: {})
      @sources = resources.map do |resource|
        cast.new(resource: resource)
      end
      @meta = meta
      @links = links
      @linked = linked
    end

    def map(&block)
      @sources.map(&block)
    end

    def meta
      @meta
    end

    def linked
      @linked
    end

    def links
      @links
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shogun-3.0.0 lib/shogun/presenters.rb
shogun-2.1.1 lib/shogun/presenters.rb
shogun-2.1.0 lib/shogun/presenters.rb
shogun-2.0.0 lib/shogun/presenters.rb
shogun-1.0.0 lib/shogun/presenters.rb