Class: Justicecz::HtmlParser

Inherits:
Object
  • Object
show all
Defined in:
lib/justicecz/html_parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ HtmlParser

Returns a new instance of HtmlParser.



3
4
5
6
# File 'lib/justicecz/html_parser.rb', line 3

def initialize(body)
  @body = ::Nokogiri::HTML(body)
  @collection = ::Justicecz::Entities::List.new
end

Class Method Details

.parse(body) ⇒ Object



8
9
10
# File 'lib/justicecz/html_parser.rb', line 8

def self.parse(body)
  new(body).parse
end

Instance Method Details

#parseObject



12
13
14
15
# File 'lib/justicecz/html_parser.rb', line 12

def parse
  parse_response
  @collection
end