Class: Puppeteer::ConsoleMessage

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

Defined Under Namespace

Classes: Location

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_type, text, args, stack_trace_locations) ⇒ ConsoleMessage

Returns a new instance of ConsoleMessage.

Parameters:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/puppeteer/console_message.rb', line 16

def initialize(log_type, text, args, stack_trace_locations)
  @log_type = log_type
  @text = text
  @args = args
  @stack_trace_locations =
    case stack_trace_locations
    when nil
      []
    when Array
      stack_trace_locations
    else
      [stack_trace_locations]
    end
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



31
32
33
# File 'lib/puppeteer/console_message.rb', line 31

def args
  @args
end

#log_typeObject (readonly)

Returns the value of attribute log_type.



31
32
33
# File 'lib/puppeteer/console_message.rb', line 31

def log_type
  @log_type
end

#textObject (readonly)

Returns the value of attribute text.



31
32
33
# File 'lib/puppeteer/console_message.rb', line 31

def text
  @text
end

Instance Method Details

#locationLocation

Returns:



34
35
36
# File 'lib/puppeteer/console_message.rb', line 34

def location
  @stack_trace_locations.first
end

#stack_traceArray<Location>

Returns:



39
40
41
# File 'lib/puppeteer/console_message.rb', line 39

def stack_trace
  @stack_trace_locations
end