Sha256: f7b5f944d58f5231dd3de78bbe87772ad1c914b02f6b2903a60f58c32752d323

Contents?: true

Size: 827 Bytes

Versions: 8

Compression:

Stored size: 827 Bytes

Contents

require 'roar/representer/json'
require 'billit_representers/representers/paperwork_representer'

module Billit
  module PaperworkCollectionRepresenter
    # include Roar::Representer
    include Roar::Representer::JSON
    include Roar::Representer::Feature::Hypermedia

    module Initializer
      def initialize
        extend Billit::PaperworkCollectionRepresenter
        extend Roar::Representer::Feature::Client
        super
      end
    end

    def self.included(klass)
      klass.send :prepend, Initializer
      klass.send :include, Roar::Representer::Feature::HttpVerbs
    end
   
    collection :paperworks, :extend => PaperworkRepresenter, :class =>  lambda { |x, *| Object.const_defined?("Paperwork") ? Paperwork : BillitPaperwork }, parse_strategy: :sync

    def paperworks
      collect
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
billit_representers-0.9.10 lib/billit_representers/representers/paperwork_collection_representer.rb
billit_representers-0.9.9 lib/billit_representers/representers/paperwork_collection_representer.rb
billit_representers-0.9.8 lib/billit_representers/representers/paperwork_collection_representer.rb
billit_representers-0.9.7 lib/billit_representers/representers/paperwork_collection_representer.rb
billit_representers-0.9.6 lib/billit_representers/representers/paperwork_collection_representer.rb
billit_representers-0.9.5 lib/billit_representers/representers/paperwork_collection_representer.rb
billit_representers-0.9.4 lib/billit_representers/representers/paperwork_collection_representer.rb
billit_representers-0.9.3 lib/billit_representers/representers/paperwork_collection_representer.rb