Class: BookingSync::Engine::CredentialsResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/bookingsync/engine/credentials_resolver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ CredentialsResolver

Returns a new instance of CredentialsResolver.


5
6
7
# File 'lib/bookingsync/engine/credentials_resolver.rb', line 5

def initialize(host)
  @host = host
end

Instance Attribute Details

#hostObject (readonly, private)

Returns the value of attribute host.


2
3
4
# File 'lib/bookingsync/engine/credentials_resolver.rb', line 2

def host
  @host
end

Instance Method Details

#applicationObject (private)


15
16
17
# File 'lib/bookingsync/engine/credentials_resolver.rb', line 15

def application
  @application ||= ::Application.find_by_host(host)
end

#callObject


9
10
11
# File 'lib/bookingsync/engine/credentials_resolver.rb', line 9

def call
  BookingSync::Engine::ApplicationCredentials.new(application)
end