Class: Bisu::Source::Url

Inherits:
Object
  • Object
show all
Defined in:
lib/bisu/source/url.rb

Instance Method Summary collapse

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_i18Object



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