Sha256: 71861f77344b33169337cda44bd7093613ef77c130a468d340fc0e14df2adb64
Contents?: true
Size: 392 Bytes
Versions: 69
Compression:
Stored size: 392 Bytes
Contents
class Eco::API::Common::People::DefaultParsers::BooleanParser < Eco::API::Common::Loaders::Parser attribute :boolean def parser(value, deps) value.is_a?(Array) ? value.map { |v| truthy(v) } : truthy(value) end def serializer(value, deps) value.to_s end private def truthy (value) %w[true y yes x].include?(value.to_s.strip.downcase) end end
Version data entries
69 entries across 69 versions & 1 rubygems