Class: Utils::IRB::Shell::ConstantWrapper

Inherits:
WrapperBase show all
Defined in:
lib/utils/irb.rb

Instance Attribute Summary collapse

Attributes inherited from WrapperBase

#description, #name

Instance Method Summary collapse

Methods inherited from WrapperBase

#<=>, #==, #hash

Constructor Details

#initialize(obj, name) ⇒ Utils::Patterns::Pattern

The initialize method sets up a new instance with the provided object and name.

This method configures the instance by storing a reference to the object’s class and creating a description string that combines the name with the class name.

Parameters:

  • obj (Object)

    the object whose class will be referenced

  • name (String)

    the name to be used in the description



371
372
373
374
375
# File 'lib/utils/irb.rb', line 371

def initialize(obj, name)
  super(name)
  @klass = obj.class
  @description = "#@name:#@klass"
end

Instance Attribute Details

#klassObject (readonly)

The klass reader method provides access to the class value stored in the instance.

Returns:

  • (Object)

    the class value



380
381
382
# File 'lib/utils/irb.rb', line 380

def klass
  @klass
end