Sha256: 8c36902acc69e0e000e555f1c894ea4a95d208148c377195b863ccf2ecfbd0d0

Contents?: true

Size: 756 Bytes

Versions: 7

Compression:

Stored size: 756 Bytes

Contents

class VolumeSnapshot < Praxis::MediaType
  identifier 'application/json'

  attributes do
    attribute :id, Integer
    attribute :name, String, regexp: /snapshot-(\w+)/
  end

  view :default do
    attribute :id
    attribute :name
  end

  view :link do
    attribute :id
  end


  class Collection < Praxis::MediaTypeCollection
    identifier 'application/json+collection'

    member_type VolumeSnapshot

    attributes do
      attribute :name, String, regexp: /snapshots-(\w+)/
      attribute :size, Integer, example: proc { |collection| collection.to_a.count }
      attribute :href, String
    end

    view :link do
      attribute :name
      attribute :size
      attribute :href
    end

    member_view :default, using: :default
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
praxis-0.13.0 spec/spec_app/design/media_types/volume_snapshot.rb
praxis-0.11.2 spec/spec_app/design/media_types/volume_snapshot.rb
praxis-0.11.1 spec/spec_app/design/media_types/volume_snapshot.rb
praxis-0.11 spec/spec_app/design/media_types/volume_snapshot.rb
praxis-0.11pre spec/spec_app/design/media_types/volume_snapshot.rb
praxis-0.10.1 spec/spec_app/design/media_types/volume_snapshot.rb
praxis-0.10.0 spec/spec_app/design/media_types/volume_snapshot.rb