Class: ConvenientService::Utils::Object::InstanceVariableDelete Private

Inherits:
Support::Command
  • Object
show all
Defined in:
lib/convenient_service/utils/object/instance_variable_delete.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(object, ivar_name) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • object (Object)
  • ivar_name (Symbol)

Since:

  • 1.0.0



29
30
31
32
# File 'lib/convenient_service/utils/object/instance_variable_delete.rb', line 29

def initialize(object, ivar_name)
  @object = object
  @ivar_name = ivar_name
end

Instance Attribute Details

#ivar_nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



22
23
24
# File 'lib/convenient_service/utils/object/instance_variable_delete.rb', line 22

def ivar_name
  @ivar_name
end

#objectObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



16
17
18
# File 'lib/convenient_service/utils/object/instance_variable_delete.rb', line 16

def object
  @object
end

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns Value of ivar. Can be any type.

Returns:

  • (Object)

    Value of ivar. Can be any type.

Since:

  • 1.0.0



37
38
39
# File 'lib/convenient_service/utils/object/instance_variable_delete.rb', line 37

def call
  object.remove_instance_variable(ivar_name) if object.instance_variable_defined?(ivar_name)
end