Class: Bisu::Source::Url
- Inherits:
-
Object
- Object
- Bisu::Source::Url
- Defined in:
- lib/bisu/source/url.rb
Instance Method Summary collapse
-
#initialize(url) ⇒ Url
constructor
A new instance of Url.
- #to_i18 ⇒ Object
Constructor Details
#initialize(url) ⇒ Url
Returns a new instance of Url.
7 8 9 |
# File 'lib/bisu/source/url.rb', line 7 def initialize(url) @url = url end |
Instance Method Details
#to_i18 ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bisu/source/url.rb', line 11 def to_i18 Logger.info("Downloading dictionary from #{@url}...") file = get(@url) hash = JSON.parse(file) Logger.info("Found #{hash.count} languages.") hash end |