Sha256: 9c0be5b373c1bfc906190b6340070874d34b8a853fbd4a7f141c3a0d0eea194f

Contents?: true

Size: 714 Bytes

Versions: 2

Compression:

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

  end

end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
traxis-0.0.2 spec/spec_app/design/media_types/volume_snapshot.rb
praxis-0.9 spec/spec_app/design/media_types/volume_snapshot.rb