Class: BasisTheory::TokenResource
- Inherits:
-
Resource
- Object
- Resource
- BasisTheory::TokenResource
show all
- Defined in:
- lib/basis_theory/resources/token_resource.rb
Instance Attribute Summary
Attributes inherited from Resource
#client
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#create(**attributes) ⇒ Object
15
16
17
|
# File 'lib/basis_theory/resources/token_resource.rb', line 15
def create(**attributes)
Token.new(post_request('tokens', body: attributes).body)
end
|
#decrypt(id) ⇒ Object
23
24
25
|
# File 'lib/basis_theory/resources/token_resource.rb', line 23
def decrypt(id)
Token.new(get_request("tokens/#{id}/decrypt").body)
end
|
#delete(id) ⇒ Object
27
28
29
|
# File 'lib/basis_theory/resources/token_resource.rb', line 27
def delete(id)
delete_request("tokens/#{id}")
end
|
19
20
21
|
# File 'lib/basis_theory/resources/token_resource.rb', line 19
def find(id)
Token.new(get_request("tokens/#{id}").body)
end
|
#list(**params) ⇒ Object
5
6
7
8
|
# File 'lib/basis_theory/resources/token_resource.rb', line 5
def list(**params)
response = get_request('tokens', params: params)
Collection.from_response(response, type: Token)
end
|
#list_decrypted(**params) ⇒ Object
10
11
12
13
|
# File 'lib/basis_theory/resources/token_resource.rb', line 10
def list_decrypted(**params)
response = get_request('tokens/decrypt', params: params)
Collection.from_response(response, type: Token)
end
|