Class: Nfe::WebService::SearchResult
- Inherits:
-
Object
- Object
- Nfe::WebService::SearchResult
- Defined in:
- lib/nfe/web_service/search_result.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(html_body) ⇒ SearchResult
constructor
A new instance of SearchResult.
- #messages ⇒ Object
Constructor Details
#initialize(html_body) ⇒ SearchResult
Returns a new instance of SearchResult.
8 9 10 |
# File 'lib/nfe/web_service/search_result.rb', line 8 def initialize(html_body) self.body = html_body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/nfe/web_service/search_result.rb', line 6 def body @body end |
Instance Method Details
#messages ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/nfe/web_service/search_result.rb', line 12 def return @msg if @msg nodes = Nokogiri::HTML(body).css('.tabela_resultado li').to_a @msg = {} nodes[0..2].each do |node| @msg[gsub_key(node)] = (node) end nodes[3].css('ul li').each do |node| @msg[gsub_key(node)] = (node) end if nodes[3] @msg end |