Class: PGLogLine

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

Constant Summary collapse

DEBUG =
false

Instance Attribute Summary collapse

Instance Method Summary collapse

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_noObject

Returns the value of attribute cmd_no.



184
185
186
# File 'lib/pqa.rb', line 184

def cmd_no
  @cmd_no
end

#connection_idObject

Returns the value of attribute connection_id.



184
185
186
# File 'lib/pqa.rb', line 184

def connection_id
  @connection_id
end

#durationObject (readonly)

Returns the value of attribute duration.



185
186
187
# File 'lib/pqa.rb', line 185

def duration
  @duration
end

#ignoreObject (readonly)

Returns the value of attribute ignore.



185
186
187
# File 'lib/pqa.rb', line 185

def ignore
  @ignore
end

#line_noObject

Returns the value of attribute line_no.



184
185
186
# File 'lib/pqa.rb', line 184

def line_no
  @line_no
end

#textObject (readonly)

Returns the value of attribute text.



185
186
187
# File 'lib/pqa.rb', line 185

def text
  @text
end

Instance Method Details

#dumpObject



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_sObject



202
203
204
# File 'lib/pqa.rb', line 202

def to_s
  @text
end