Class: Hash

Inherits:
Object show all
Includes:
RubyApp::Mixins::HashMixin
Defined in:
lib/ruby_app/mixins/hash_mixin.rb

Instance Method Summary collapse

Methods included from RubyApp::Mixins::HashMixin

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RubyApp::Mixins::HashMixin

Instance Method Details

#prepend!(key, value) ⇒ Object



25
26
27
# File 'lib/ruby_app/mixins/hash_mixin.rb', line 25

def prepend!(key, value)
  self[key] = "#{value} #{self[key]}"
end

#symbolize!Object



29
30
31
32
33
34
35
36
37
# File 'lib/ruby_app/mixins/hash_mixin.rb', line 29

def symbolize!
  copy=self.dup
  self.clear
  copy.each do |name, value|
    value.symbolize! if value.is_a?(Hash)
    self[name.to_sym] = value
  end
  return self
end