Class: ERB

Inherits:
Object
  • Object
show all
Defined in:
lib/active_notifier/core_ext/erb/result_with_hash.rb

Overview

Add #result_with_hash for version less than 2.5

Instance Method Summary collapse

Instance Method Details

#result_with_hash(hash) ⇒ Object


4
5
6
7
8
9
10
# File 'lib/active_notifier/core_ext/erb/result_with_hash.rb', line 4

def result_with_hash(hash)
  b = new_toplevel(hash.keys)
  hash.each_pair do |key, value|
    b.local_variable_set(key, value)
  end
  result(b)
end