parent
21e1c42b54
commit
0a4f39be58
@ -0,0 +1,28 @@ |
||||
require 'roar/decorator' |
||||
require 'roar/representer/json' |
||||
require 'roar/representer/json/hal' |
||||
|
||||
module Projects |
||||
class ProjectRepresenter < Roar::Decorator |
||||
include Roar::Representer::JSON |
||||
include Roar::Representer::Feature::Hypermedia |
||||
include Roar::Representer::JSON::HAL |
||||
|
||||
property :id |
||||
property :name |
||||
property :description |
||||
property :homepage |
||||
property :is_public |
||||
property :created_on |
||||
property :updated_on |
||||
property :identifier |
||||
property :status |
||||
property :summary |
||||
|
||||
link :self do |
||||
"/project/#{represented.id}" |
||||
end |
||||
|
||||
property :responsible, class: User, decorator: Users::UserRepresenter, embedded: true |
||||
end |
||||
end |
@ -0,0 +1,30 @@ |
||||
require 'roar/decorator' |
||||
require 'roar/representer/json' |
||||
require 'roar/representer/json/hal' |
||||
|
||||
module Users |
||||
class UserRepresenter < Roar::Decorator |
||||
include Roar::Representer::JSON |
||||
include Roar::Representer::Feature::Hypermedia |
||||
include Roar::Representer::JSON::HAL |
||||
|
||||
property :id |
||||
property :login |
||||
property :firstname |
||||
property :lastname |
||||
property :mail |
||||
property :admin |
||||
property :status |
||||
property :last_login_on |
||||
property :language |
||||
property :created_on |
||||
property :updated_on |
||||
property :type |
||||
property :identity_url |
||||
property :mail_notification |
||||
|
||||
link :self do |
||||
"/users/#{represented.id}" |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue