Sha256: 19a86a4e8df1d8b41639ddf2ff31be953fd72a97d12b426fa8698d75bf2fa32d

Contents?: true

Size: 747 Bytes

Versions: 1

Compression:

Stored size: 747 Bytes

Contents

module Trackerific
  module Parsers
    class Base
      def initialize(package_id, response)
        @package_id = package_id
        @response = response
      end

      def parse
        @result ||= if response_error
          response_error
        else
          Trackerific::Details.new(@package_id, summary, events)
        end
      end

      protected

      def response_error
        raise NotImplementedError,
          "Override this method in your parser", caller
      end

      def summary
        raise NotImplementedError,
          "Override this method in your parser", caller
      end

      def events
        raise NotImplementedError,
          "Override this method in your parser", caller
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trackerific-0.7.2 lib/trackerific/parsers/base.rb