Module: Stands4
- Includes:
- HTTParty
- Defined in:
- lib/Stands4.rb,
lib/Stands4/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
- .abbr(term) ⇒ Object
- .configure(uid, tokenid) ⇒ Object
- .conv(expression) ⇒ Object
- .defs(word) ⇒ Object
- .phrases(phrase) ⇒ Object
- .quotes(searchtype = 'RANDOM', query = '') ⇒ Object
- .rhymes(term) ⇒ Object
- .syno(word) ⇒ Object
- .zip(zip) ⇒ Object
Class Method Details
.abbr(term) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/Stands4.rb', line 13 def self.abbr(term) = { :query => { :uid => @@uid, :tokenid => @@tokenid, :term => term } } results = get('/services/v2/abbr.php', ) end |
.configure(uid, tokenid) ⇒ Object
8 9 10 11 |
# File 'lib/Stands4.rb', line 8 def self.configure(uid, tokenid) @@uid = uid @@tokenid = tokenid end |
.conv(expression) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/Stands4.rb', line 45 def self.conv(expression) = { :query => { :uid => @@uid, :tokenid => @@tokenid, :expression => expression } } results = get('/services/v2/conv.php', ) end |
.defs(word) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/Stands4.rb', line 29 def self.defs(word) = { :query => { :uid => @@uid, :tokenid => @@tokenid, :word => word } } results = get('/services/v2/defs.php', ) end |
.phrases(phrase) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/Stands4.rb', line 61 def self.phrases(phrase) = { :query => { :uid => @@uid, :tokenid => @@tokenid, :phrase => phrase } } results = get('/services/v2/phrases.php', ) end |
.quotes(searchtype = 'RANDOM', query = '') ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/Stands4.rb', line 69 def self.quotes(searchtype='RANDOM', query='') = { :query => { :uid => @@uid, :tokenid => @@tokenid, :searchtype => searchtype, :query => query, } } results = get('/services/v2/quotes.php', ) end |
.rhymes(term) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/Stands4.rb', line 37 def self.rhymes(term) = { :query => { :uid => @@uid, :tokenid => @@tokenid, :term => term } } results = get('/services/v2/rhymes.php', ) end |
.syno(word) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/Stands4.rb', line 53 def self.syno(word) = { :query => { :uid => @@uid, :tokenid => @@tokenid, :word => word } } results = get('/services/v2/syno.php', ) end |
.zip(zip) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/Stands4.rb', line 21 def self.zip(zip) = { :query => { :uid => @@uid, :tokenid => @@tokenid, :zip => zip } } results = get('/services/v2/zip.php', ) end |