Class: Hash

Inherits:
Object show all
Defined in:
lib/react/hash.rb,
lib/react/ext/hash.rb

Instance Method Summary collapse

Constructor Details

#initialize(defaults = undefined, &block) ⇒ Hash

Returns a new instance of Hash.



5
6
7
8
9
10
11
# File 'lib/react/hash.rb', line 5

def initialize(defaults = undefined, &block)
  if (`defaults===null`)
    _pre_react_patch_initialize(&block)
  else
    _pre_react_patch_initialize(defaults, &block)
  end
end

Instance Method Details

#_pre_react_patch_initializeObject



3
# File 'lib/react/hash.rb', line 3

alias_method :_pre_react_patch_initialize, :initialize

#shallow_to_nObject



2
3
4
5
6
7
8
# File 'lib/react/ext/hash.rb', line 2

def shallow_to_n
  hash = `{}`
  self.map do |key, value|
     `hash[#{key}] = #{value}`
  end
  hash
end