Sha256: 840b50e38b02dfcb74f49c865be47103d50726d0536e59a4b2020a28eae3b7d7
Contents?: true
Size: 799 Bytes
Versions: 37
Compression:
Stored size: 799 Bytes
Contents
module Eco module API module Common module People class DefaultParsers class SendInvitesParser < People::BaseParser def process @parsers.define_attribute("send_invites") do |parser| parser.def_parser do |hash| value = hash["send_invites"] value.is_a?(Array) ? value.map { |v| truthy(v) } : truthy(value) end.def_serializer do |person| person.account && person.account.send_invites&.to_s end end end private def truthy (value) %w[true y yes x].include?(value.to_s&.downcase) end end end end end end end
Version data entries
37 entries across 37 versions & 1 rubygems