Class: Linguin::Languages

Inherits:
BaseResponse show all
Defined in:
lib/linguin/languages.rb

Overview

Linguin::Languages

Returns a hash of supported languages.

Constant Summary

Constants inherited from BaseResponse

BaseResponse::CODE_MAP

Instance Attribute Summary

Attributes inherited from BaseResponse

#error

Class Method Summary collapse

Methods inherited from BaseResponse

from_httparty, #initialize, #raise_on_error!

Constructor Details

This class inherits a constructor from Linguin::BaseResponse

Class Method Details

.error(code, message) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/linguin/languages.rb', line 8

def error(code, message)
  new do |status|
    status.error = {
      code: code,
      message: message
    }
  end.raise_on_error!
end

.success(response) ⇒ Object



17
18
19
# File 'lib/linguin/languages.rb', line 17

def success(response)
  response
end