Class: Ecoportal::API::Internal::LoginProviders

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ecoportal/api/internal/login_providers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ LoginProviders

Returns an instance object ready to make login providers api requests.

Parameters:

  • client (Common::Client)

    a Common::Client object that holds the configuration of the api connection.



12
13
14
# File 'lib/ecoportal/api/internal/login_providers.rb', line 12

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientCommon::Client (readonly)

a Common::Client object that holds the configuration of the api connection.

Returns:



5
6
7
# File 'lib/ecoportal/api/internal/login_providers.rb', line 5

def client
  @client
end

Instance Method Details

#each(&block) ⇒ Object



23
24
25
26
# File 'lib/ecoportal/api/internal/login_providers.rb', line 23

def each(&block)
  return to_enum(:each) unless block
  get_all.each(&block)
end

#get_allEnumerable<LoginProvider>

Gets all the login providers via api request.

Returns:

  • (Enumerable<LoginProvider>)

    an Enumerable with all login providers already wrapped as LoginProvider objects.



18
19
20
21
# File 'lib/ecoportal/api/internal/login_providers.rb', line 18

def get_all
  response = @client.get("/login_providers")
  Common::WrappedResponse.new(response, Internal::LoginProvider)
end