Sha256: 32562bee97ab3bbf30e2a853d4fb23bec173bf2529d4da872901c3ff4a044750

Contents?: true

Size: 591 Bytes

Versions: 93

Compression:

Stored size: 591 Bytes

Contents

class Eco::API::Common::People::DefaultParsers::LoginProvidersParser < Eco::API::Common::Loaders::Parser
  attribute "login_provider_ids"
  parsing_phase     :final
  serializing_phase :final

  def parser(hash, deps)
    hash["login_provider_ids"].map do |name|
      login_providers.to_id(name&.downcase.strip)
    end.compact
  end

  def serializer(hash, deps)
    if ids = hash["login_provider_ids"]
      login_providers.to_name(ids)
    else
      []
    end
  end

  private

  def login_providers
    @login_providers ||= config.login_providers
  end

end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
eco-helpers-2.0.30 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.29 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.28 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.27 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.26 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.25 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.24 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.23 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.22 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.21 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.19 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.18 lib/eco/api/common/people/default_parsers/login_providers_parser.rb
eco-helpers-2.0.17 lib/eco/api/common/people/default_parsers/login_providers_parser.rb