Class: ThatLanguage::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/that_language/client.rb,
lib/that_language/client/query.rb,
lib/that_language/client/config.rb,
lib/that_language/client/version.rb,
lib/that_language/client/detect_query.rb,
lib/that_language/client/details_query.rb,
lib/that_language/client/version_query.rb,
lib/that_language/client/language_query.rb,
lib/that_language/client/available_query.rb,
lib/that_language/client/language_code_query.rb

Defined Under Namespace

Classes: AvailableQuery, Config, DetailsQuery, DetectQuery, LanguageCodeQuery, LanguageQuery, Query, VersionQuery

Constant Summary collapse

VERSION =
"0.1.2"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host:) ⇒ Client

Returns a new instance of Client.



17
18
19
# File 'lib/that_language/client.rb', line 17

def initialize(host:)
  @host = host
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



15
16
17
# File 'lib/that_language/client.rb', line 15

def host
  @host
end

Class Method Details

.configObject



25
26
27
# File 'lib/that_language/client.rb', line 25

def self.config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



29
30
31
# File 'lib/that_language/client.rb', line 29

def self.configure
  yield(config)
end

.currentObject



21
22
23
# File 'lib/that_language/client.rb', line 21

def self.current
  @current ||= Client.new(host: config.host)
end