Sha256: 4ff5f263c3b0d260577608bacb10d4ae22d76f6f9ecf00a6eae8aa73a44bd4a1

Contents?: true

Size: 950 Bytes

Versions: 3

Compression:

Stored size: 950 Bytes

Contents

require 'roar/representer'
require 'roar/representer/feature/http_verbs'
require 'roar/representer/feature/client'
# require 'roar/representer/json'
# require 'roar/rails/hal'
require 'roar/representer/json/hal'

module Billit
  module PaperworkRepresenter
    include Roar::Representer::JSON::HAL
    # include Roar::Representer::JSON

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

    def self.included(klass)
      klass.send :prepend, Initializer
      klass.send :include, Roar::Representer::Feature::HttpVerbs
    end

    property :chamber
    property :created_at
    property :date
    property :description
    property :session
    property :stage
    property :updated_at
    property :bill_uid

    link :self do
      paperwork_url(self.id)
    end

    link :bill do
      bill_url(bill_uid)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
billit_representers-0.8.4 lib/billit_representers/representers/paperwork_representer.rb
billit_representers-0.8.3 lib/billit_representers/representers/paperwork_representer.rb
billit_representers-0.8.2 lib/billit_representers/representers/paperwork_representer.rb