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

Version Path
fandango-0.2.1 lib/fandango/parser.rb
fandango-0.2.0 lib/fandango/parser.rb
fandango-0.1.9 lib/fandango/parser.rb
fandango-0.1.8 lib/fandango/parser.rb
fandango-0.1.7 lib/fandango/parser.rb
fandango-0.1.6 lib/fandango/parser.rb
fandango-0.1.5 lib/fandango/parser.rb
fandango-0.1.4 lib/fandango/parser.rb
fandango-0.1.3 lib/fandango/parser.rb
fandango-0.1.2 lib/fandango/parser.rb
fandango-0.1.1 lib/fandango/parser.rb
fandango-0.1.0 lib/fandango/parser.rb