yandex-dictionary 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e080ecede7634b48277b6fac44385a29a6d9485f
4
- data.tar.gz: c954ec274fdfda1dd05f3644312acf8af0f16007
3
+ metadata.gz: 2c392d3b9c2caa2a456e24749a7766247b23eb71
4
+ data.tar.gz: 91746fc7ca97a0c7919d201a5e60d19d7ca269fa
5
5
  SHA512:
6
- metadata.gz: b269932144afce0e34f3890411455d12d5d666be1cdb90bafcfa917765b631972b7dd7b20f4de8e66914c776519e0ee144c2d8cd041513d19e303c0c87050fc5
7
- data.tar.gz: 2e53981bc5b39b4b08db43de38b7f54fbf64c12c1589606e5f6e644858a8b23e12061a669ee4c4ddca74345e3c669f0fd4fb30c61f88e7e71a7e1d59bbb52726
6
+ metadata.gz: f2281aa71ab5371e0012d863d0b9a1d4a16f7674b96cc0c54792884a3101d184d005e67a3ba4ebfcf5d0c8352f5b4dfbdbb2916b2febee212d25c832b19644e4
7
+ data.tar.gz: 101fb555eb0ad537840461598e64a6f05ad411444c030bd393449c912ad40c3b7b92bb0b4c7f8e285dd3c67f609b3c3edf9b7cdb6d8811fa0090676886e8d980
@@ -12,17 +12,17 @@ module Yandex::Dictionary
12
12
 
13
13
  # List of translation directions.
14
14
  def get_langs
15
- visit '/getLangs', key: api_key
15
+ visit('/getLangs').to_a
16
16
  end
17
17
 
18
18
  # Search word or phrase. Return dictionary entry.
19
19
  def lookup(text, *lang)
20
- options = { key: api_key, text: text, lang: lang.join('-') }
21
- visit('/lookup', options)
20
+ options = { text: text, lang: lang.join('-') }
21
+ visit('/lookup', options)['def']
22
22
  end
23
23
 
24
24
  def visit(address, options = {})
25
- responce = get(address, query: options)
25
+ responce = get address, query: options.merge(key: api_key)
26
26
  check_errors(responce) unless responce.code == 200
27
27
  responce
28
28
  end
@@ -1,6 +1,6 @@
1
1
  module Yandex
2
2
  module Dictionary
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yandex-dictionary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Smagin
@@ -30,6 +30,7 @@ executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
+ - lib/.yandex_dictionary.rb.swp
33
34
  - lib/yandex_dictionary.rb
34
35
  - lib/yandex_dictionary/version.rb
35
36
  homepage: https://github.com/s-mage/yandex-dictionary