Class: Fog::Compute::Packet::Membership

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

Overview

Membership Model

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Membership

Returns a new instance of Membership.



16
17
18
# File 'lib/fog/compute/packet/models/membership.rb', line 16

def initialize(attributes = {})
  super
end

Instance Method Details

#destroyObject



30
31
32
33
34
# File 'lib/fog/compute/packet/models/membership.rb', line 30

def destroy
  requires :id
  response = service.delete_membership(id)
  true if response.status == 204
end

#updateObject



20
21
22
23
24
25
26
27
28
# File 'lib/fog/compute/packet/models/membership.rb', line 20

def update
  requires :id
  options = {
    :roles => roles
  }

  response = service.update_membership(id, options)
  merge_attributes(response.body) if response.status == 200
end