Sha256: 3f1298d33f74341c0ca2e83b45dc1a022b14d2837d98da03de42962ae8eaca8c

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

require 'roar/representer/json'
require 'roar/representer/feature/http_verbs'
require 'roar/representer/feature/hypermedia'

module JSON
  
  class Item
    include Roar::Representer::JSON
    
    property :article_id
    property :amount
    
    include Roar::Representer::Feature::HttpVerbs
    include Roar::Representer::Feature::Hypermedia
  end
  
  
  class Order
    include Roar::Representer::JSON
    property :client_id
    collection :items, :as => Item
    
    
    include Roar::Representer::Feature::HttpVerbs
    include Roar::Representer::Feature::Hypermedia
    
    
    link :items do
      items_url
    end
    
    link :self do
      order_url(represented)
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roar-0.8.3 test/order_representers.rb
roar-0.8.2 test/order_representers.rb
roar-0.8.1 test/order_representers.rb