Sha256: c66e0df5d8feaf8c79ecb49cb02fbfa95bb1abff14937aa66a27197558d7dfd7

Contents?: true

Size: 803 Bytes

Versions: 14

Compression:

Stored size: 803 Bytes

Contents

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

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

    module Initializer
      def initialize
        extend Billit::PaperworkCollectionModelRepresenter
        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 => Billit::PaperworkRepresenter, :class => Billit::Paperwork

    def paperworks
      collect
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
billit_representers-0.9.2 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.9.1 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.9.0 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.12 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.11 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.10 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.9 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.8 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.7 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.6 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.5 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.4 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.3 lib/billit_representers/representers/paperwork_collection_model_representer.rb
billit_representers-0.8.2 lib/billit_representers/representers/paperwork_collection_model_representer.rb