Sha256: 93c0a245ee8251c5d20448f0dbfe9e74421d9511f93c0593c1fba1c08e9bc0b3
Contents?: true
Size: 352 Bytes
Versions: 1
Compression:
Stored size: 352 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 bindings_for(arg) return {} unless self.binding_name flattened = arg.inject([]){|memo, kv| memo + kv} {self.binding_name => Hash[*flattened]} end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
erlectricity-0.1.0 | lib/erlectricity/conditions/hash.rb |