Sha256: 5066b5d19003ba7835c98843293352857e7926df39d55ed7fe05c2bd56b921f7

Contents?: true

Size: 831 Bytes

Versions: 16

Compression:

Stored size: 831 Bytes

Contents

# -*- encoding: UTF-8 -*-
require 'ostruct'

module CSD
  module Extensions
    module Core
      # This module comprises extensions to OpenStruct.
      #
      module OpenStruct
        
        # Deletes all attributes of this OpenStruct instance.
        #
        def clear
          testmode = self.testmode # This is the only thing we would not like to overwrite. It indicates whether we are running our Test Suite or not.
          @table = {}
          self.testmode = testmode
        end
        
        # A nicer version of inspect (it only removes the helptext attribute)
        #
        def inspect_for_debug
          result = self.dup
          result.helptext = nil
          result.inspect
        end
        
      end
    end
  end
end

class Object #:nodoc:
  include CSD::Extensions::Core::OpenStruct
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
csd-0.4.3 lib/csd/extensions/core/open_struct.rb
csd-0.4.2 lib/csd/extensions/core/open_struct.rb
csd-0.4.1 lib/csd/extensions/core/open_struct.rb
csd-0.4.0 lib/csd/extensions/core/open_struct.rb
csd-0.3.7 lib/csd/extensions/core/open_struct.rb
csd-0.3.6 lib/csd/extensions/core/open_struct.rb
csd-0.3.5 lib/csd/extensions/core/open_struct.rb
csd-0.3.4 lib/csd/extensions/core/open_struct.rb
csd-0.3.3 lib/csd/extensions/core/open_struct.rb
csd-0.3.2 lib/csd/extensions/core/open_struct.rb
csd-0.3.1 lib/csd/extensions/core/open_struct.rb
csd-0.3.0 lib/csd/extensions/core/open_struct.rb
csd-0.2.2 lib/csd/extensions/core/open_struct.rb
csd-0.2.1 lib/csd/extensions/core/open_struct.rb
csd-0.2.0 lib/csd/extensions/core/open_struct.rb
csd-0.1.18 lib/csd/extensions/core/open_struct.rb