Class: DetectLanguage::Client
- Inherits:
-
Object
- Object
- DetectLanguage::Client
- Defined in:
- lib/detect_language/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #get(path) ⇒ Object
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
- #post(path, payload = {}) ⇒ Object
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
#config ⇒ Object (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 |