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.



416
417
418
419
# File 'lib/teradata-cli/connection.rb', line 416

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.



421
422
423
# File 'lib/teradata-cli/connection.rb', line 421

def flavor_name
  @flavor_name
end

Instance Method Details

#dataObject



427
428
429
# File 'lib/teradata-cli/connection.rb', line 427

def data
  @cli.data
end

#messageObject



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

def message
  @cli.message
end

#sql_statusObject



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

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