Sha256: ac83b3aad0590cef56cdc1bb815bb7e68be297587680b10db95379856d4c6d50

Contents?: true

Size: 632 Bytes

Versions: 8

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

class Book < Praxis::MediaType
  identifier 'application/vnd.acme.book'

  domain_model 'Resources::Book'

  attributes do
    attribute :id, Integer
    attribute :name, String
    attribute :simple_name, String
    attribute :category_uuid, String
    attribute :author, Author
    attribute :tags, Praxis::Collection.of(Tag)
    attribute :special, String, displayable: 'special#read'
    attribute :multi, String, displayable: ['special#read', 'normal#read']

    group :grouped do
      attribute :id
      attribute :name
      attribute :moar_tags, Praxis::Collection.of(Tag)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
praxis-2.0.0 spec/spec_app/design/media_types/book.rb
praxis-2.0.pre.40 spec/spec_app/design/media_types/book.rb
praxis-2.0.pre.39 spec/spec_app/design/media_types/book.rb
praxis-2.0.pre.38 spec/spec_app/design/media_types/book.rb
praxis-2.0.pre.37 spec/spec_app/design/media_types/book.rb
praxis-2.0.pre.36 spec/spec_app/design/media_types/book.rb
praxis-2.0.pre.35 spec/spec_app/design/media_types/book.rb
praxis-2.0.pre.34 spec/spec_app/design/media_types/book.rb