Class: Iqdb::Client::Parser::Result
- Inherits:
-
Object
- Object
- Iqdb::Client::Parser::Result
- Defined in:
- lib/iqdb/client/parser/result.rb
Instance Attribute Summary collapse
-
#nokogiri_obj ⇒ Object
readonly
Returns the value of attribute nokogiri_obj.
Instance Method Summary collapse
- #alt ⇒ Object
- #info ⇒ Object
-
#initialize(nokogiri_obj) ⇒ Result
constructor
A new instance of Result.
- #link ⇒ Object
Constructor Details
#initialize(nokogiri_obj) ⇒ Result
Returns a new instance of Result.
7 8 9 |
# File 'lib/iqdb/client/parser/result.rb', line 7 def initialize(nokogiri_obj) @nokogiri_obj = nokogiri_obj end |
Instance Attribute Details
#nokogiri_obj ⇒ Object (readonly)
Returns the value of attribute nokogiri_obj.
5 6 7 |
# File 'lib/iqdb/client/parser/result.rb', line 5 def nokogiri_obj @nokogiri_obj end |
Instance Method Details
#alt ⇒ Object
15 16 17 |
# File 'lib/iqdb/client/parser/result.rb', line 15 def alt @alt ||= Alt.new(@nokogiri_obj.xpath('.//td[@class="image"]//img[1]/@alt').text) end |
#info ⇒ Object
19 20 21 |
# File 'lib/iqdb/client/parser/result.rb', line 19 def info { link: link, tags: alt., rating: alt. } end |
#link ⇒ Object
11 12 13 |
# File 'lib/iqdb/client/parser/result.rb', line 11 def link @link ||= @nokogiri_obj.xpath('.//a[1]/@href').text end |