Class: TeradataCli::FetchedParcel

Inherits:
Object
  • Object
show all
Defined in:
lib/teradata-cli/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flavor_name, cli) ⇒ FetchedParcel

Returns a new instance of FetchedParcel.



418
419
420
421
# File 'lib/teradata-cli/connection.rb', line 418

def initialize(flavor_name, cli)
  @flavor_name = flavor_name
  @cli = cli
end

Instance Attribute Details

#flavor_nameObject (readonly)

Returns the value of attribute flavor_name.



423
424
425
# File 'lib/teradata-cli/connection.rb', line 423

def flavor_name
  @flavor_name
end

Instance Method Details

#dataObject



429
430
431
# File 'lib/teradata-cli/connection.rb', line 429

def data
  @cli.data
end

#messageObject



425
426
427
# File 'lib/teradata-cli/connection.rb', line 425

def message
  @cli.message
end

#sql_statusObject



433
434
435
436
437
438
439
440
441
# File 'lib/teradata-cli/connection.rb', line 433

def sql_status
  case @flavor_name
  when 'PclSUCCESS' then SuccessStatus.parse(@cli.data)
  when 'PclFAILURE' then FailureStatus.parse(@cli.data)
  when 'PclERROR'   then ErrorStatus.parse(@cli.data)
  else
    raise "must not happen: \#sql_status called for flavor #{@flavor_name}"
  end
end