Class: Seatsio::HoldTokensClient
- Inherits:
-
Object
- Object
- Seatsio::HoldTokensClient
- Defined in:
- lib/seatsio/hold_tokens.rb
Instance Method Summary collapse
- #create(expires_in_minutes: nil) ⇒ Object
- #expire_in_minutes(hold_token, expires_in_minutes = nil) ⇒ Object
- #initialize(http_client) ⇒ Seatsio::HoldTokensClient constructor
- #retrieve(hold_token) ⇒ Object
Constructor Details
#initialize(http_client) ⇒ Seatsio::HoldTokensClient
14 15 16 |
# File 'lib/seatsio/hold_tokens.rb', line 14 def initialize(http_client) @http_client = http_client end |
Instance Method Details
#create(expires_in_minutes: nil) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/seatsio/hold_tokens.rb', line 18 def create(expires_in_minutes: nil) body = {} if expires_in_minutes body[:expiresInMinutes] = expires_in_minutes end response = @http_client.post('hold-tokens', body) HoldToken.new(response) end |
#expire_in_minutes(hold_token, expires_in_minutes = nil) ⇒ Object
32 33 34 35 36 |
# File 'lib/seatsio/hold_tokens.rb', line 32 def expire_in_minutes(hold_token, expires_in_minutes = nil) body = {"expiresInMinutes": expires_in_minutes} response = @http_client.post("hold-tokens/#{hold_token}", body) HoldToken.new(response) end |