Class: Teradata::FetchedParcel

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flavor_name, cli) ⇒ FetchedParcel

Returns a new instance of FetchedParcel.



415
416
417
418
# File 'lib/teradata/connection.rb', line 415

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.



420
421
422
# File 'lib/teradata/connection.rb', line 420

def flavor_name
  @flavor_name
end

Instance Method Details

#dataObject



426
427
428
# File 'lib/teradata/connection.rb', line 426

def data
  @cli.data
end

#messageObject



422
423
424
# File 'lib/teradata/connection.rb', line 422

def message
  @cli.message
end

#sql_statusObject



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

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