Class: Tessera::Api::TicketGet

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ticket_id) ⇒ TicketGet

Returns a new instance of TicketGet.



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

def initialize(ticket_id)
  @ticket_id = ticket_id
end

Class Method Details

.call(ticket_id) ⇒ Object



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

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

Instance Method Details

#callObject



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

def call
  response = Tessera::Request.new(:GET, "Ticket/#{@ticket_id}", body).send
  JSON.parse(response.body)
end

#session_idObject



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

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