Sha256: f6de20cbb17f5987770c3f097dc20b9a00e5c713a08e9f8eba68a1def8a84dc4

Contents?: true

Size: 837 Bytes

Versions: 7

Compression:

Stored size: 837 Bytes

Contents

require 'roar/representer/json'
require 'billit_representers_argentina/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

7 entries across 7 versions & 1 rubygems

Version Path
billit_representers_argentina-0.9.17 lib/billit_representers_argentina/representers/paperwork_collection_representer.rb
billit_representers_argentina-0.9.16 lib/billit_representers_argentina/representers/paperwork_collection_representer.rb
billit_representers_argentina-0.9.14 lib/billit_representers_argentina/representers/paperwork_collection_representer.rb
billit_representers_argentina-0.9.13 lib/billit_representers_argentina/representers/paperwork_collection_representer.rb
billit_representers_argentina-0.9.12 lib/billit_representers_argentina/representers/paperwork_collection_representer.rb
billit_representers_argentina-0.9.11 lib/billit_representers_argentina/representers/paperwork_collection_representer.rb
billit_representers_argentina-0.9.10 lib/billit_representers_argentina/representers/paperwork_collection_representer.rb