Sha256: 0acb2b899c14f3ac37c45c2c87abfa33587d77fc7fb789deca5d7071cbc27c47
Contents?: true
Size: 312 Bytes
Versions: 8
Compression:
Stored size: 312 Bytes
Contents
module Erlectricity class HashCondition < Condition def satisfies?(arg) return false unless arg.class == Array arg.all? { |x| x.class == Array && x.length == 2 } end def binding_for(arg) flattened = arg.inject([]) { |memo, kv| memo + kv } Hash[*flattened] end end end
Version data entries
8 entries across 8 versions & 3 rubygems