Class: Tessera::Api::TicketCreate

Inherits:
Object
  • Object
show all
Defined in:
lib/tessera/api/ticket_create.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body_content) ⇒ TicketCreate

Returns a new instance of TicketCreate.



8
9
10
# File 'lib/tessera/api/ticket_create.rb', line 8

def initialize(body_content)
  @body = body.merge(body_content)
end

Class Method Details

.call(body_content) ⇒ Object



12
13
14
# File 'lib/tessera/api/ticket_create.rb', line 12

def self.call(body_content)
  new(body_content).call
end

Instance Method Details

#callObject



16
17
18
19
# File 'lib/tessera/api/ticket_create.rb', line 16

def call
  response = Tessera::Request.new(:POST, 'Ticket', @body).send
  JSON.parse(response.body)
end

#session_idObject



21
22
23
24
25
# File 'lib/tessera/api/ticket_create.rb', line 21

def session_id
  session = Session.create
  # TODO: solve token creation failure with error
  session.session_id
end