lib/helpers.rb in yaml-validator-0.1.1 vs lib/helpers.rb in yaml-validator-0.1.2

- old
+ new

@@ -18,7 +18,15 @@ def self.array_to_hash(array) hash = {} array.each_with_index { |val, i| hash[i.to_s] = val } hash end + + def self.pluralization?(object) + return false if object.nil? + + keys = object.keys.map { |k| k.to_sym } + + (keys.include? :one) and (keys.include? :other) + end end