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/language_query.rb,
lib/that_language/client/language_code_query.rb

Defined Under Namespace

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

Constant Summary collapse

VERSION =
"0.1.1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host:) ⇒ Client



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

def initialize(host:)
  @host = host
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



13
14
15
# File 'lib/that_language/client.rb', line 13

def host
  @host
end

Class Method Details

.configObject



23
24
25
# File 'lib/that_language/client.rb', line 23

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

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

Yields:



27
28
29
# File 'lib/that_language/client.rb', line 27

def self.configure
  yield(config)
end

.currentObject



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

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