Sha256: cca94f86ddab4f56b8bf9f8a2cf4ba19b87a55b433c698521c4ae18b78e7d830

Contents?: true

Size: 542 Bytes

Versions: 2

Compression:

Stored size: 542 Bytes

Contents

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

  attributes do
    attribute :id, Integer
    attribute :name, String

    attribute :source, VolumeSnapshot

    # returns VolumeSnapshot::Collection if exists
    attribute :snapshots, Praxis::Collection.of(VolumeSnapshot)

    links do
      link :source
      link :snapshots
    end

  end

  view :default do
    attribute :id
    attribute :name
    attribute :source
    attribute :snapshots
    attribute :links
  end

  view :link do
    attribute :id
  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.rb
praxis-0.9 spec/spec_app/design/media_types/volume.rb