Class: Dictuby::OnlineDictionary

Inherits:
Object
  • Object
show all
Defined in:
lib/dictuby/online_dictionary.rb

Direct Known Subclasses

DictCC, SlovnikCZ, SlovnikSK

Class Method Summary collapse

Class Method Details

.dictsObject



23
24
25
# File 'lib/dictuby/online_dictionary.rb', line 23

def self.dicts
    @dicts
end

.lookup(dict, query) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/dictuby/online_dictionary.rb', line 8

def self.lookup(dict, query)
    url = @url % {
        :dict => @dicts[dict],
        :query => query,
    }

    page = Nokogiri::HTML(open(url))

    self.process(page, query)
end

.nameObject



19
20
21
# File 'lib/dictuby/online_dictionary.rb', line 19

def self.name
    @name
end