Class: Eligible::PublicKey
Instance Attribute Summary
#api_key, #eligible_id
Class Method Summary
collapse
Methods inherited from APIResource
api_url, class_name, require_param, send_request, url
#[], #[]=, construct_from, #each, #error, #initialize, #keys, #refresh_from, #to_hash, #to_json, #values
Class Method Details
.activate(params, api_key = nil) ⇒ Object
13
14
15
16
|
# File 'lib/eligible/public_key.rb', line 13
def self.activate(params, api_key = nil)
key_id = Util.value(params, :key_id)
send_request(:get, "/public_keys/#{key_id}/activate.json", api_key, params, :key_id)
end
|
.all(params, api_key = nil) ⇒ Object
18
19
20
|
# File 'lib/eligible/public_key.rb', line 18
def self.all(params, api_key = nil)
send_request(:get, api_url('public_keys'), api_key, **params)
end
|
.create_pair ⇒ Object
22
23
24
25
|
# File 'lib/eligible/public_key.rb', line 22
def self.create_pair
rsa_key = OpenSSL::PKey::RSA.new(4096)
[ rsa_key.to_pem, rsa_key.public_key.to_pem ]
end
|
.get(params, api_key = nil) ⇒ Object
5
6
7
|
# File 'lib/eligible/public_key.rb', line 5
def self.get(params, api_key = nil)
send_request(:get, api_url('public_keys', params, :key_id), api_key, params, :key_id)
end
|
.post(params, api_key = nil) ⇒ Object
9
10
11
|
# File 'lib/eligible/public_key.rb', line 9
def self.post(params, api_key = nil)
send_request(:post, api_url('public_keys'), api_key, **params)
end
|