Class: ConvenientService::Utils::Object::InstanceVariableDelete
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Object::InstanceVariableDelete
- Defined in:
- lib/convenient_service/utils/object/instance_variable_delete.rb
Instance Attribute Summary collapse
-
#ivar_name ⇒ Object
readonly
Returns the value of attribute ivar_name.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#call ⇒ Object
Value of ivar.
- #initialize(object, ivar_name) ⇒ void constructor
Methods inherited from Support::Command
Constructor Details
#initialize(object, ivar_name) ⇒ void
32 33 34 35 |
# File 'lib/convenient_service/utils/object/instance_variable_delete.rb', line 32 def initialize(object, ivar_name) @object = object @ivar_name = ivar_name end |
Instance Attribute Details
#ivar_name ⇒ Object (readonly)
Returns the value of attribute ivar_name.
25 26 27 |
# File 'lib/convenient_service/utils/object/instance_variable_delete.rb', line 25 def ivar_name @ivar_name end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
19 20 21 |
# File 'lib/convenient_service/utils/object/instance_variable_delete.rb', line 19 def object @object end |
Instance Method Details
#call ⇒ Object
Returns Value of ivar. Can be any type.
40 41 42 |
# File 'lib/convenient_service/utils/object/instance_variable_delete.rb', line 40 def call object.remove_instance_variable(ivar_name) if object.instance_variable_defined?(ivar_name) end |