Sha256: c26fe570000484d3448fdeff2b7364957936e45539cd045bd77ad40d931ceb52

Contents?: true

Size: 863 Bytes

Versions: 13

Compression:

Stored size: 863 Bytes

Contents

# frozen_string_literal: true

##
#
#
module ConvenientService
  module Utils
    module Object
      class InstanceVariableDelete < Support::Command
        ##
        # @!attribute [r] object
        #   @return [Object]
        #
        attr_reader :object

        ##
        # @!attribute [r] ivar_name
        #   @return [Symbol, String]
        #
        attr_reader :ivar_name

        ##
        # @param object [Object]
        # @param ivar_name [Symbol]
        # @return [void]
        #
        def initialize(object, ivar_name)
          @object = object
          @ivar_name = ivar_name
        end

        ##
        # @return [Object] Value of ivar. Can be any type.
        #
        def call
          return object.remove_instance_variable(ivar_name) if object.instance_variable_defined?(ivar_name)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
convenient_service-0.17.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.16.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.15.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.14.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.13.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.12.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.11.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.10.1 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.10.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.9.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.8.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.7.0 lib/convenient_service/utils/object/instance_variable_delete.rb
convenient_service-0.6.0 lib/convenient_service/utils/object/instance_variable_delete.rb