Sha256: a9d4ae5249a145408f63af692515f6869dce5efac406084513dbbea461033fa1
Contents?: true
Size: 534 Bytes
Versions: 12
Compression:
Stored size: 534 Bytes
Contents
class Fandango::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. def initialize(entry) @entry = entry @entry.define_singleton_method(:summary_doc) do @summary_doc ||= Nokogiri.HTML(summary) end end def parse_theater Theater.new(@entry).parse end def parse_movies Movie.new(@entry).parse end end require 'fandango/parsers/theater' require 'fandango/parsers/movie'
Version data entries
12 entries across 12 versions & 1 rubygems