Class: PGLogLine
- Inherits:
-
Object
- Object
- PGLogLine
- Defined in:
- lib/pqa.rb
Direct Known Subclasses
PGContextLine, PGContinuationLine, PGDetailLine, PGDurationLine, PGErrorLine, PGHintLine, PGQueryStarter, PGStatementLine, PGStatusLine
Constant Summary collapse
- DEBUG =
false
Instance Attribute Summary collapse
-
#cmd_no ⇒ Object
Returns the value of attribute cmd_no.
-
#connection_id ⇒ Object
Returns the value of attribute connection_id.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#ignore ⇒ Object
readonly
Returns the value of attribute ignore.
-
#line_no ⇒ Object
Returns the value of attribute line_no.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(text = "NO TEXT", duration = nil) ⇒ PGLogLine
constructor
A new instance of PGLogLine.
- #parse_duration(time_str, unit) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(text = "NO TEXT", duration = nil) ⇒ PGLogLine
Returns a new instance of PGLogLine.
187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/pqa.rb', line 187 def initialize(text = "NO TEXT", duration = nil) @text = text.chomp @duration = duration if text.nil? $stderr.puts "Nil text for line text !" if DEBUG end # for tracking @connection_id = nil @cmd_no = nil @line_no = nil end |
Instance Attribute Details
#cmd_no ⇒ Object
Returns the value of attribute cmd_no.
184 185 186 |
# File 'lib/pqa.rb', line 184 def cmd_no @cmd_no end |
#connection_id ⇒ Object
Returns the value of attribute connection_id.
184 185 186 |
# File 'lib/pqa.rb', line 184 def connection_id @connection_id end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
185 186 187 |
# File 'lib/pqa.rb', line 185 def duration @duration end |
#ignore ⇒ Object (readonly)
Returns the value of attribute ignore.
185 186 187 |
# File 'lib/pqa.rb', line 185 def ignore @ignore end |
#line_no ⇒ Object
Returns the value of attribute line_no.
184 185 186 |
# File 'lib/pqa.rb', line 184 def line_no @line_no end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
185 186 187 |
# File 'lib/pqa.rb', line 185 def text @text end |
Instance Method Details
#dump ⇒ Object
210 211 212 |
# File 'lib/pqa.rb', line 210 def dump self.class.to_s + "(" + @connection_id.to_s + "): " + text end |
#parse_duration(time_str, unit) ⇒ Object
206 207 208 |
# File 'lib/pqa.rb', line 206 def parse_duration(time_str, unit) unit == "ms" ? (time_str.to_f / 1000.0) : time_str.to_f end |
#to_s ⇒ Object
202 203 204 |
# File 'lib/pqa.rb', line 202 def to_s @text end |