Sha256: a9d85ec25ee964c2039b0ce3000fa828aeeff49bfb90413e2a9a98fe24604ea8

Contents?: true

Size: 572 Bytes

Versions: 9

Compression:

Stored size: 572 Bytes

Contents

class Instance < Praxis::MediaType

  identifier 'application/vnd.acme.instance'

  attributes do
    attribute :id, Integer
    attribute :name, String, example: /[:first_name:]/

    attribute :href, String

    attribute :root_volume, Volume

    links do
      link :root_volume
      link :other_volume, Volume, using: :data_volume
    end
  end

  view :default do
    attribute :id
    attribute :root_volume
    attribute :links
  end

  view :link do
    attribute :id
    attribute :href
  end

  view :create do
    attribute :id
    attribute :name
  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
praxis-0.13.0 spec/spec_app/design/media_types/instance.rb
praxis-0.11.2 spec/spec_app/design/media_types/instance.rb
praxis-0.11.1 spec/spec_app/design/media_types/instance.rb
praxis-0.11 spec/spec_app/design/media_types/instance.rb
praxis-0.11pre spec/spec_app/design/media_types/instance.rb
praxis-0.10.1 spec/spec_app/design/media_types/instance.rb
praxis-0.10.0 spec/spec_app/design/media_types/instance.rb
traxis-0.0.2 spec/spec_app/design/media_types/instance.rb
praxis-0.9 spec/spec_app/design/media_types/instance.rb