Class: FidorApi::Client

Inherits:
Object
  • Object
show all
Includes:
Authentication, DSL
Defined in:
lib/fidor_api/client.rb,
lib/fidor_api/client/dsl.rb,
lib/fidor_api/client/dsl/cards.rb,
lib/fidor_api/client/connection.rb,
lib/fidor_api/client/dsl/accounts.rb,
lib/fidor_api/client/dsl/messages.rb,
lib/fidor_api/client/dsl/preauths.rb,
lib/fidor_api/client/configuration.rb,
lib/fidor_api/client/dsl/core_data.rb,
lib/fidor_api/client/dsl/transfers.rb,
lib/fidor_api/client/authentication.rb,
lib/fidor_api/client/dsl/transactions.rb,
lib/fidor_api/client/dsl/debit_returns.rb,
lib/fidor_api/client/dsl/standing_orders.rb,
lib/fidor_api/client/dsl/transfers/classic.rb,
lib/fidor_api/client/dsl/transfers/generic.rb,
lib/fidor_api/client/dsl/confirmable_actions.rb,
lib/fidor_api/client/dsl/scheduled_transfers.rb

Defined Under Namespace

Modules: Authentication, DSL Classes: Configuration, Connection

Instance Attribute Summary collapse

Attributes included from Authentication

#token

Instance Method Summary collapse

Methods included from DSL

included

Methods included from Authentication

#authorize_complete, #authorize_start, #client_login, #login

Constructor Details

#initialize {|config| ... } ⇒ Client

Returns a new instance of Client.

Yields:



13
14
15
16
17
# File 'lib/fidor_api/client.rb', line 13

def initialize
  self.config = Configuration.new
  yield(config) if block_given?
  config.validate!
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



11
12
13
# File 'lib/fidor_api/client.rb', line 11

def config
  @config
end

Instance Method Details

#connection(host: config.environment.api_host) ⇒ Object



19
20
21
# File 'lib/fidor_api/client.rb', line 19

def connection(host: config.environment.api_host)
  Connection.new(client: self, host: host)
end