Codes:
- L: Likes
- D: Dislikes
- M: Meh.
Depending on the persona for successful negotiation you need either 2 Like answers or 1 Like + 1 Meh.
def run_with_elapsed_time | |
time_at_start = Time.now | |
exception = nil | |
result = yield | |
rescue => e | |
exception = e | |
ensure | |
return [ result, exception, Time.now - time_at_start ] | |
end |
my_string.scan(/[a-z\d]+/).each_with_object(Hash.new(0)){ |e, a| a[e] += 1 } |
Codes:
Depending on the persona for successful negotiation you need either 2 Like answers or 1 Like + 1 Meh.
class MyClass | |
def static_yield(*) | |
yield if block_given? | |
end | |
define_method :dynamic_yield do |*| | |
yield if block_given? | |
end | |
define_method :dynamic_yield_fix do |*, &block| |