Class: StaticTracing::Tracepoint

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-static-tracing/tracepoint.rb

Overview

:nodoc:

Defined Under Namespace

Classes: InvalidArgType, InvalidArgumentError

Constant Summary collapse

VALID_ARGS_TYPES =
[Integer, String]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider, name, *args) ⇒ Tracepoint

Returns a new instance of Tracepoint.



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ruby-static-tracing/tracepoint.rb', line 23

def initialize(provider, name, *args)
  @provider = provider
  @name = name
  validate_args(args)
  @args = args

  if StaticTracing::Platform.supported_platform?
    tracepoint_initialize(provider, name, args)
  else
    StaticTracing.issue_disabled_tracepoints_warning
  end
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



21
22
23
# File 'lib/ruby-static-tracing/tracepoint.rb', line 21

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



21
22
23
# File 'lib/ruby-static-tracing/tracepoint.rb', line 21

def name
  @name
end

#providerObject (readonly)

Returns the value of attribute provider.



21
22
23
# File 'lib/ruby-static-tracing/tracepoint.rb', line 21

def provider
  @provider
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


43
44
# File 'lib/ruby-static-tracing/tracepoint.rb', line 43

def enabled?
end

#fire(*values) ⇒ Object



36
37
38
39
40
41
# File 'lib/ruby-static-tracing/tracepoint.rb', line 36

def fire(*values)
  values.each_with_index do |arg, i|
    raise InvalidArgumentError.new(arg, args[i]) unless arg.is_a?(args[i])
  end
  _fire_tracepoint(values)
end