Class: Shared::MutableCollection Abstract

Inherits:
Collection show all
Defined in:
lib/vas/shared/mutable_collection.rb

Overview

This class is abstract.

A collection that allows items to be created

Instance Attribute Summary

Attributes inherited from Resource

#location, #security

Instance Method Summary collapse

Methods inherited from Collection

#each, #initialize, #reload

Constructor Details

This class inherits a constructor from Shared::Collection

Instance Method Details

#create(payload, rel = nil) ⇒ Object



23
24
25
26
27
# File 'lib/vas/shared/mutable_collection.rb', line 23

def create(payload, rel=nil)
  created = create_entry(client.post(location, payload, rel))
  reload
  created
end

#create_image(path, payload = nil) ⇒ Object



30
31
32
33
34
# File 'lib/vas/shared/mutable_collection.rb', line 30

def create_image(path, payload=nil)
  created = create_entry(client.post_image(location, path, payload))
  reload
  created
end