Class: Dictuby::OnlineDictionary
- Inherits:
-
Object
- Object
- Dictuby::OnlineDictionary
show all
- Defined in:
- lib/dictuby/online_dictionary.rb
Class Method Summary
collapse
Class Method Details
.dicts ⇒ Object
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
|
.name ⇒ Object
19
20
21
|
# File 'lib/dictuby/online_dictionary.rb', line 19
def self.name
@name
end
|