Class: Fog::Compute::Packet::Project

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/packet/models/project.rb

Overview

Project Model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Project

Returns a new instance of Project.



24
25
26
# File 'lib/fog/compute/packet/models/project.rb', line 24

def initialize(attributes = {})
  super
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



22
23
24
# File 'lib/fog/compute/packet/models/project.rb', line 22

def options
  @options
end

Instance Method Details

#destroyObject



38
39
40
41
42
43
# File 'lib/fog/compute/packet/models/project.rb', line 38

def destroy
  requires :id

  response = service.delete_project(id)
  true if response.status == 204
end

#save(payment_method_id = "") ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/fog/compute/packet/models/project.rb', line 28

def save(payment_method_id = "")
  requires :name

  options = {}
  options[:name] = name
  options[:payment_method_id] = payment_method_id if payment_method_id
  response = service.create_project(options)
  merge_attributes(response.body)
end