lib/tap/support/configurable_class.rb in bahuvrihi-tap-0.10.6 vs lib/tap/support/configurable_class.rb in bahuvrihi-tap-0.10.7
- old
+ new
@@ -269,24 +269,24 @@
# Returns special argument types for standard validation
# blocks, such as switch (Validation::SWITCH) and list
# (Validation::LIST).
def arg_type(block) # :nodoc:
- case block
- when Validation::SWITCH then :switch
- when Validation::FLAG then :flag
- when Validation::LIST then :list
+ case
+ when block == Validation::SWITCH then :switch
+ when block == Validation::FLAG then :flag
+ when block == Validation::LIST then :list
else nil
end
end
# Returns special argument names for standard validation
# blocks, such as switch (Validation::ARRAY) and list
# (Validation::HASH).
def arg_name(block) # :nodoc:
- case block
- when Validation::ARRAY then "'[a, b, c]'"
- when Validation::HASH then "'{one: 1, two: 2}'"
+ case
+ when block == Validation::ARRAY then "'[a, b, c]'"
+ when block == Validation::HASH then "'{one: 1, two: 2}'"
else nil
end
end
end
\ No newline at end of file