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.
454 455 456 457 458 459 460 461 |
# File 'lib/teradata-cli/connection.rb', line 454 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.
465 466 467 |
# File 'lib/teradata-cli/connection.rb', line 465 def acitivity_type @acitivity_type end |
#activity_count ⇒ Object (readonly)
Returns the value of attribute activity_count.
464 465 466 |
# File 'lib/teradata-cli/connection.rb', line 464 def activity_count @activity_count end |
#n_fields ⇒ Object (readonly)
Returns the value of attribute n_fields.
466 467 468 |
# File 'lib/teradata-cli/connection.rb', line 466 def n_fields @n_fields end |
#statement_no ⇒ Object (readonly)
Returns the value of attribute statement_no.
463 464 465 |
# File 'lib/teradata-cli/connection.rb', line 463 def statement_no @statement_no end |
#warning ⇒ Object (readonly)
Returns the value of attribute warning.
468 469 470 |
# File 'lib/teradata-cli/connection.rb', line 468 def warning @warning end |
#warning_code ⇒ Object (readonly)
Returns the value of attribute warning_code.
467 468 469 |
# File 'lib/teradata-cli/connection.rb', line 467 def warning_code @warning_code end |
Class Method Details
.parse(parcel_data) ⇒ Object
448 449 450 451 452 |
# File 'lib/teradata-cli/connection.rb', line 448 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
507 508 509 |
# File 'lib/teradata-cli/connection.rb', line 507 def echo? @activity_type == ACTIVITY_ECHO end |
#error? ⇒ Boolean
494 495 496 |
# File 'lib/teradata-cli/connection.rb', line 494 def error? false end |
#error_code ⇒ Object
474 475 476 |
# File 'lib/teradata-cli/connection.rb', line 474 def error_code 0 end |
#failure? ⇒ Boolean
490 491 492 |
# File 'lib/teradata-cli/connection.rb', line 490 def failure? false end |
#info ⇒ Object
478 479 480 |
# File 'lib/teradata-cli/connection.rb', line 478 def info nil end |
#inspect ⇒ Object
470 471 472 |
# File 'lib/teradata-cli/connection.rb', line 470 def inspect "\#<Success \##{@statement_no} cnt=#{@activity_count}>" end |
#message ⇒ Object
482 483 484 |
# File 'lib/teradata-cli/connection.rb', line 482 def '' end |
#succeeded? ⇒ Boolean
486 487 488 |
# File 'lib/teradata-cli/connection.rb', line 486 def succeeded? true end |
#value ⇒ Object
498 499 |
# File 'lib/teradata-cli/connection.rb', line 498 def value end |
#warned? ⇒ Boolean
501 502 503 |
# File 'lib/teradata-cli/connection.rb', line 501 def warned? @warning_code != 0 end |