Sha256: bf88205a4589c33c892062904a9f44da5d68293dbb92d68ce80a088f293faef7
Contents?: true
Size: 389 Bytes
Versions: 40
Compression:
Stored size: 389 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
40 entries across 40 versions & 1 rubygems