Sha256: 1f6c77e5fa85f6d6eb93a4467c07ab56754d090297337f66da58eac2a837c806

Contents?: true

Size: 632 Bytes

Versions: 2

Compression:

Stored size: 632 Bytes

Contents

##
#
#
#
module Tessera
  module Api
    class TicketGet
      def initialize(ticket_id)
        @ticket_id = ticket_id
      end

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

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

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

      private

      def body
        {
          TicketID: @ticket_id,
          SessionID: session_id
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tessera-1.0.1 lib/tessera/api/ticket_get.rb
tessera-1.0.0 lib/tessera/api/ticket_get.rb