Class: Boss::Web::Result
- Inherits:
-
Object
- Object
- Boss::Web::Result
- Defined in:
- lib/boss.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
- #abstract ⇒ Object
- #clickurl ⇒ Object
- #date ⇒ Object
- #dispurl(options = {}) ⇒ Object
-
#initialize(r) ⇒ Result
constructor
A new instance of Result.
- #keyterms ⇒ Object
- #size ⇒ Object
- #strip_wbr(s) ⇒ Object
- #title ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(r) ⇒ Result
Returns a new instance of Result.
268 269 270 |
# File 'lib/boss.rb', line 268 def initialize(r) @result = r end |
Instance Attribute Details
#result ⇒ Object
Returns the value of attribute result.
266 267 268 |
# File 'lib/boss.rb', line 266 def result @result end |
Instance Method Details
#abstract ⇒ Object
276 277 278 |
# File 'lib/boss.rb', line 276 def abstract @result['abstract'] end |
#clickurl ⇒ Object
280 281 282 |
# File 'lib/boss.rb', line 280 def clickurl @result['clickurl'] end |
#date ⇒ Object
284 285 286 |
# File 'lib/boss.rb', line 284 def date @result['date'] end |
#dispurl(options = {}) ⇒ Object
288 289 290 291 292 293 294 295 |
# File 'lib/boss.rb', line 288 def dispurl( = {}) data = @result['dispurl'] if [:wbr] == false strip_wbr(data) else data end end |
#keyterms ⇒ Object
297 298 299 |
# File 'lib/boss.rb', line 297 def keyterms @result['keyterms']['terms'] end |
#size ⇒ Object
301 302 303 |
# File 'lib/boss.rb', line 301 def size @result['size'].to_i end |
#strip_wbr(s) ⇒ Object
272 273 274 |
# File 'lib/boss.rb', line 272 def strip_wbr(s) s.gsub(/<wbr>/, '') end |
#title ⇒ Object
305 306 307 |
# File 'lib/boss.rb', line 305 def title @result['title'] end |
#url ⇒ Object
309 310 311 |
# File 'lib/boss.rb', line 309 def url @result['url'] end |