Sha256: 46553891b0e3b2f75d15c05c4dfb5b802468bd35d4dfe6a8b10a31ff2244eed8

Contents?: true

Size: 642 Bytes

Versions: 4

Compression:

Stored size: 642 Bytes

Contents

class Instance < Praxis::MediaType

  identifier 'application/vnd.acme.instance'

  attributes do
    attribute :id, Integer
    attribute :name, String, 
      example: /[:first_name:]/,
      regexp: /^\w+$/

    attribute :href, String

    attribute :root_volume, Volume

    attribute :volumes, Volume::Collection
    
  end

  view :default do
    attribute :id
    attribute :root_volume
  end

  view :link do
    attribute :id
    attribute :href
  end

  view :create do
    attribute :id
    attribute :name
  end

  view :extended, include_nil: true do
    attribute :id
    attribute :name
    attribute :root_volume
  end


end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
praxis-2.0.pre.9 spec/spec_app/design/media_types/instance.rb
praxis-2.0.pre.8 spec/spec_app/design/media_types/instance.rb
praxis-2.0.pre.7 spec/spec_app/design/media_types/instance.rb
praxis-2.0.pre.6 spec/spec_app/design/media_types/instance.rb