module Linguin

Linguin API wrapper module

Can be used as a singleton to access all API methods. Alternatively, Linguin::Client can be instantiated.

Linguin.detect

:text:

The text to be used for language detection.

Attempts to detect the language of the given text. Returns a Linguin::Response object.

Linguin.detect!

:text:

The text to be used for language detection.

Just like detect but raises an exception if anything goes wrong.

Linguin.status

Returns the status of your Linguin account as Linguin::Status

Linguin.languages

Returns the list of supported languages.

Constants

VERSION

Public Class Methods

api_key=(api_key) click to toggle source
# File lib/linguin.rb, line 37
def api_key=(api_key)
  default_client.api_key = api_key
end
detect_language(text) click to toggle source
# File lib/linguin.rb, line 41
def detect_language(text)
  default_client.detect_language(text)
end
detect_language!(text) click to toggle source
# File lib/linguin.rb, line 45
def detect_language!(text)
  default_client.detect_language!(text)
end
detect_profanity(text) click to toggle source
# File lib/linguin.rb, line 49
def detect_profanity(text)
  default_client.detect_profanity(text)
end
detect_profanity!(text) click to toggle source
# File lib/linguin.rb, line 53
def detect_profanity!(text)
  default_client.detect_profanity!(text)
end
languages() click to toggle source
# File lib/linguin.rb, line 61
def languages
  default_client.languages
end
status() click to toggle source
# File lib/linguin.rb, line 57
def status
  default_client.status
end

Private Class Methods

default_client() click to toggle source
# File lib/linguin.rb, line 67
def default_client
  @default_client ||= Client.new
end