Class: DetectLanguage::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/detect_language/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



9
10
11
# File 'lib/detect_language/client.rb', line 9

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/detect_language/client.rb', line 7

def config
  @config
end

Instance Method Details

#get(path) ⇒ Object



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

def get(path)
  execute(Net::HTTP::Get, path)
end

#post(path, payload = {}) ⇒ Object



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

def post(path, payload = {})
  execute(Net::HTTP::Post, path, body: payload.to_json)
end