Class: Object

Inherits:
BasicObject
Defined in:
lib/ruby_ext/micelaneous.rb,
lib/ruby_ext/deep_clone.rb,
lib/ruby_ext/declarative_cache.rb

Overview

string_or_symbol?

Instance Method Summary collapse

Instance Method Details

#clear_cache_methodObject



14
15
16
17
18
# File 'lib/ruby_ext/declarative_cache.rb', line 14

def clear_cache_method
  instance_variables.each do |iv|
    remove_instance_variable iv if iv =~ /^@cached_/
  end
end

#deep_cloneObject



2
3
4
5
6
7
8
9
# File 'lib/ruby_ext/deep_clone.rb', line 2

def deep_clone
  clone = self.clone
  instance_variables.each do |name|
    value = instance_variable_get name
    clone.instance_variable_set name, value.deep_clone
  end
  clone
end

#string_or_symbol?Boolean

Returns:

  • (Boolean)


5
# File 'lib/ruby_ext/micelaneous.rb', line 5

def string_or_symbol?; false end