Class: TeradataCli::SuccessStatus
- Inherits:
-
Object
- Object
- TeradataCli::SuccessStatus
- Defined in:
- lib/teradata-cli/connection.rb
Constant Summary collapse
- ACTIVITY_ECHO =
33
Instance Attribute Summary collapse
-
#acitivity_type ⇒ Object
readonly
Returns the value of attribute acitivity_type.
-
#activity_count ⇒ Object
readonly
Returns the value of attribute activity_count.
-
#n_fields ⇒ Object
readonly
Returns the value of attribute n_fields.
-
#statement_no ⇒ Object
readonly
Returns the value of attribute statement_no.
-
#warning ⇒ Object
readonly
Returns the value of attribute warning.
-
#warning_code ⇒ Object
readonly
Returns the value of attribute warning_code.
Class Method Summary collapse
Instance Method Summary collapse
- #echo? ⇒ Boolean
- #error? ⇒ Boolean
- #error_code ⇒ Object
- #failure? ⇒ Boolean
- #info ⇒ Object
-
#initialize(stmt_no, act_cnt, warn_code, n_fields, act_type, warning) ⇒ SuccessStatus
constructor
A new instance of SuccessStatus.
- #inspect ⇒ Object
- #message ⇒ Object
- #succeeded? ⇒ Boolean
- #value ⇒ Object
- #warned? ⇒ Boolean
Constructor Details
#initialize(stmt_no, act_cnt, warn_code, n_fields, act_type, warning) ⇒ SuccessStatus
Returns a new instance of SuccessStatus.
452 453 454 455 456 457 458 459 |
# File 'lib/teradata-cli/connection.rb', line 452 def initialize(stmt_no, act_cnt, warn_code, n_fields, act_type, warning) @statement_no = stmt_no @activity_count = act_cnt @warning_code = warn_code @num_fields = n_fields @activity_type = act_type @warning = warning end |
Instance Attribute Details
#acitivity_type ⇒ Object (readonly)
Returns the value of attribute acitivity_type.
463 464 465 |
# File 'lib/teradata-cli/connection.rb', line 463 def acitivity_type @acitivity_type end |
#activity_count ⇒ Object (readonly)
Returns the value of attribute activity_count.
462 463 464 |
# File 'lib/teradata-cli/connection.rb', line 462 def activity_count @activity_count end |
#n_fields ⇒ Object (readonly)
Returns the value of attribute n_fields.
464 465 466 |
# File 'lib/teradata-cli/connection.rb', line 464 def n_fields @n_fields end |
#statement_no ⇒ Object (readonly)
Returns the value of attribute statement_no.
461 462 463 |
# File 'lib/teradata-cli/connection.rb', line 461 def statement_no @statement_no end |
#warning ⇒ Object (readonly)
Returns the value of attribute warning.
466 467 468 |
# File 'lib/teradata-cli/connection.rb', line 466 def warning @warning end |
#warning_code ⇒ Object (readonly)
Returns the value of attribute warning_code.
465 466 467 |
# File 'lib/teradata-cli/connection.rb', line 465 def warning_code @warning_code end |
Class Method Details
.parse(parcel_data) ⇒ Object
446 447 448 449 450 |
# File 'lib/teradata-cli/connection.rb', line 446 def SuccessStatus.parse(parcel_data) stmt_no, _, act_cnt, warn_code, n_fields, act_type, warn_len = parcel_data.unpack('CCLSSSS') warning = parcel_data[13, warn_len] new(stmt_no, act_cnt, warn_code, n_fields, act_type, warning) end |
Instance Method Details
#echo? ⇒ Boolean
505 506 507 |
# File 'lib/teradata-cli/connection.rb', line 505 def echo? @activity_type == ACTIVITY_ECHO end |
#error? ⇒ Boolean
492 493 494 |
# File 'lib/teradata-cli/connection.rb', line 492 def error? false end |
#error_code ⇒ Object
472 473 474 |
# File 'lib/teradata-cli/connection.rb', line 472 def error_code 0 end |
#failure? ⇒ Boolean
488 489 490 |
# File 'lib/teradata-cli/connection.rb', line 488 def failure? false end |
#info ⇒ Object
476 477 478 |
# File 'lib/teradata-cli/connection.rb', line 476 def info nil end |
#inspect ⇒ Object
468 469 470 |
# File 'lib/teradata-cli/connection.rb', line 468 def inspect "\#<Success \##{@statement_no} cnt=#{@activity_count}>" end |
#message ⇒ Object
480 481 482 |
# File 'lib/teradata-cli/connection.rb', line 480 def '' end |
#succeeded? ⇒ Boolean
484 485 486 |
# File 'lib/teradata-cli/connection.rb', line 484 def succeeded? true end |
#value ⇒ Object
496 497 |
# File 'lib/teradata-cli/connection.rb', line 496 def value end |
#warned? ⇒ Boolean
499 500 501 |
# File 'lib/teradata-cli/connection.rb', line 499 def warned? @warning_code != 0 end |