Sha256: 46054e04ab9f9dfa39238618459358a4d9a902bf0c6cc96bc718017fa57e65ad

Contents?: true

Size: 823 Bytes

Versions: 15

Compression:

Stored size: 823 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
    
    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

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


end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
praxis-2.0.pre.5 spec/spec_app/design/media_types/instance.rb
praxis-2.0.pre.4 spec/spec_app/design/media_types/instance.rb
praxis-2.0.pre.3 spec/spec_app/design/media_types/instance.rb
praxis-2.0.pre.2 spec/spec_app/design/media_types/instance.rb
praxis-2.0.pre.1 spec/spec_app/design/media_types/instance.rb
praxis-0.22.pre.2 spec/spec_app/design/media_types/instance.rb
praxis-0.22.pre.1 spec/spec_app/design/media_types/instance.rb
praxis-0.21 spec/spec_app/design/media_types/instance.rb
praxis-0.20.1 spec/spec_app/design/media_types/instance.rb
praxis-0.20.0 spec/spec_app/design/media_types/instance.rb
praxis-0.19.0 spec/spec_app/design/media_types/instance.rb
praxis-0.18.1 spec/spec_app/design/media_types/instance.rb
praxis-0.18.0 spec/spec_app/design/media_types/instance.rb
praxis-0.17.1 spec/spec_app/design/media_types/instance.rb
praxis-0.17.0 spec/spec_app/design/media_types/instance.rb