Class: Hash
Instance Method Summary collapse
- #_pre_react_patch_initialize ⇒ Object
-
#initialize(defaults = undefined, &block) ⇒ Hash
constructor
A new instance of Hash.
- #shallow_to_n ⇒ Object
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_initialize ⇒ Object
3 |
# File 'lib/react/hash.rb', line 3 alias_method :_pre_react_patch_initialize, :initialize |
#shallow_to_n ⇒ Object
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 |