Class: DebugLogging::LambDart::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/debug_logging/lamb_dart/base.rb

Direct Known Subclasses

Log, Note

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance: nil, klass: nil, method_config_opts:, method_payload:, args:, kwargs:, decorated_method:) ⇒ Base

Returns a new instance of Base.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/debug_logging/lamb_dart/base.rb', line 20

def initialize(instance: nil, klass: nil, method_config_opts:, method_payload:, args:, kwargs:, decorated_method:)
  @instance = instance || klass
  @klass = klass || instance.class
  @method_payload = method_payload
  @args = args
  @kwargs = kwargs
  @decorated_method = decorated_method
  @is_class = (self.klass == self.instance)
  @scope_term = is_class ? "class" : "instance"
  @config_proxy = DebugLogging::Util.config_proxy_finder(
    scope: self.klass,
    config_opts: method_config_opts,
    method_name: self.decorated_method,
    proxy_ref:,
  ) do |proxy|
    yield proxy if block_given?
  end
end

Instance Attribute Details

#argsObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def args
  @args
end

#config_proxyObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def config_proxy
  @config_proxy
end

#decorated_methodObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def decorated_method
  @decorated_method
end

#instanceObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def instance
  @instance
end

#is_classObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def is_class
  @is_class
end

#klassObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def klass
  @klass
end

#kwargsObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def kwargs
  @kwargs
end

#method_payloadObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def method_payload
  @method_payload
end

#scope_termObject (readonly)

For ClassLogger, this will be the same as klass



8
9
10
# File 'lib/debug_logging/lamb_dart/base.rb', line 8

def scope_term
  @scope_term
end