Class: MotionOcean::Resource::Key

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/motion_ocean/resource/key.rb

Constant Summary

Constants included from Base

Base::PER_PAGE

Instance Attribute Summary

Attributes included from Base

#api_client

Instance Method Summary collapse

Methods included from Base

#initialize

Instance Method Details

#all(&block) ⇒ Object



10
11
12
# File 'lib/motion_ocean/resource/key.rb', line 10

def all(&block)
  get('account/keys', &block)
end

#create(options, &block) ⇒ Object



6
7
8
# File 'lib/motion_ocean/resource/key.rb', line 6

def create(options, &block)
  post('account/keys', options.to_json)
end

#destroy(key_id, &block) ⇒ Object



22
23
24
# File 'lib/motion_ocean/resource/key.rb', line 22

def destroy(key_id, &block)
  delete("account/keys/#{key_id}", &block)
end

#show(key_id, &block) ⇒ Object



14
15
16
# File 'lib/motion_ocean/resource/key.rb', line 14

def show(key_id, &block)
  get("account/keys/#{key_id}", &block)
end

#update(key_id, options, &block) ⇒ Object



18
19
20
# File 'lib/motion_ocean/resource/key.rb', line 18

def update(key_id, options, &block)
  put("account/keys/#{key_id}", options.to_json, &block)
end