Class: Fandango::Parser
- Inherits:
-
Object
- Object
- Fandango::Parser
- Defined in:
- lib/fandango/parser.rb
Defined Under Namespace
Instance Method Summary collapse
-
#initialize(entry) ⇒ Parser
constructor
Cache entry.
- #parse_movies ⇒ Object
- #parse_theater ⇒ Object
Constructor Details
#initialize(entry) ⇒ Parser
Cache entry. Define entry.summary_doc as Nokogiri HTML document. Both theater and movie parsers use summary, and we only want to use Nokogiri once per entry.
6 7 8 9 10 11 |
# File 'lib/fandango/parser.rb', line 6 def initialize(entry) @entry = entry @entry.define_singleton_method(:summary_doc) do @summary_doc ||= Nokogiri.HTML(summary) end end |