Class: ThatLanguage::Client::AvailableQuery
- Defined in:
- lib/that_language/client/available_query.rb
Instance Attribute Summary
Attributes inherited from Query
Instance Method Summary collapse
-
#available ⇒ Object
The exception to the rule in Query#language_name: this hash is keyed by symbol in the core gem (
{ak: :Akan}), so the code is a symbol here even though language_code(text) returns a string. -
#initialize(client: Client.current) ⇒ AvailableQuery
constructor
FIXME: do not pass text to super.
Methods inherited from Query
Constructor Details
#initialize(client: Client.current) ⇒ AvailableQuery
FIXME: do not pass text to super
7 8 9 |
# File 'lib/that_language/client/available_query.rb', line 7 def initialize(client: Client.current) super(text: "", client: client) end |
Instance Method Details
#available ⇒ Object
The exception to the rule in Query#language_name: this hash is keyed by
symbol in the core gem ({ak: :Akan}), so the code is a symbol here
even though language_code(text) returns a string.
14 15 16 |
# File 'lib/that_language/client/available_query.rb', line 14 def available @available ||= json["available"].to_h { |code, name| [code.to_sym, language_name(name)] } end |