Class: Ethikdo::Provision

Inherits:
BaseModel show all
Defined in:
lib/ethikdo/provision.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from BaseModel

#initialize

Constructor Details

This class inherits a constructor from Ethikdo::BaseModel

Instance Attribute Details

#capture_tokenObject

Returns the value of attribute capture_token.



6
7
8
# File 'lib/ethikdo/provision.rb', line 6

def capture_token
  @capture_token
end

#card_numberObject

Returns the value of attribute card_number.



5
6
7
# File 'lib/ethikdo/provision.rb', line 5

def card_number
  @card_number
end

#card_valueObject

Returns the value of attribute card_value.



7
8
9
# File 'lib/ethikdo/provision.rb', line 7

def card_value
  @card_value
end

#countObject

Returns the value of attribute count.



14
15
16
# File 'lib/ethikdo/provision.rb', line 14

def count
  @count
end

#date_createdObject

Returns the value of attribute date_created.



8
9
10
# File 'lib/ethikdo/provision.rb', line 8

def date_created
  @date_created
end

#date_usedObject

Returns the value of attribute date_used.



9
10
11
# File 'lib/ethikdo/provision.rb', line 9

def date_used
  @date_used
end

#error_codeObject

Returns the value of attribute error_code.



12
13
14
# File 'lib/ethikdo/provision.rb', line 12

def error_code
  @error_code
end

#messageObject

Returns the value of attribute message.



13
14
15
# File 'lib/ethikdo/provision.rb', line 13

def message
  @message
end

#nextObject

Returns the value of attribute next.



15
16
17
# File 'lib/ethikdo/provision.rb', line 15

def next
  @next
end

#previousObject

Returns the value of attribute previous.



16
17
18
# File 'lib/ethikdo/provision.rb', line 16

def previous
  @previous
end

#resultsObject

Returns the value of attribute results.



17
18
19
# File 'lib/ethikdo/provision.rb', line 17

def results
  @results
end

#status_codeObject

Returns the value of attribute status_code.



11
12
13
# File 'lib/ethikdo/provision.rb', line 11

def status_code
  @status_code
end

#urlObject

Returns the value of attribute url.



10
11
12
# File 'lib/ethikdo/provision.rb', line 10

def url
  @url
end

Class Method Details

.allObject



24
25
26
27
# File 'lib/ethikdo/provision.rb', line 24

def self.all
  response = execute('get', '/provisions/')
  self.new(response.parsed_response)
end

.create(card_number:, card_crypto:) ⇒ Object



19
20
21
22
# File 'lib/ethikdo/provision.rb', line 19

def self.create(card_number:, card_crypto:)
  response = execute("post", '/provisions/', body: { card_number: card_number, card_crypto: card_crypto })
  self.new(response.parsed_response)
end