Sha256: 4c12555555800a0734412d31f9853f76dfbc07168043a726cc797eaf517ce786

Contents?: true

Size: 707 Bytes

Versions: 11

Compression:

Stored size: 707 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, :class => 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

11 entries across 11 versions & 1 rubygems

Version Path
roar-0.11.4 test/order_representers.rb
roar-0.11.3 test/order_representers.rb
roar-0.11.2 test/order_representers.rb
roar-0.11.1 test/order_representers.rb
roar-0.11.0 test/order_representers.rb
roar-0.10.2 test/order_representers.rb
roar-0.10.1 test/order_representers.rb
roar-0.10.0 test/order_representers.rb
roar-0.9.2 test/order_representers.rb
roar-0.9.1 test/order_representers.rb
roar-0.9.0 test/order_representers.rb