Sha256: 626ae8262e2ed063e65d1106f27f3b53f847b68797144ec66912d0472c9cddf3

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

module AmazonSellerCentral
  class Page
    attr_accessor :body

    def initialize(options={})
      @page  = options.delete(:page)
      @agent = options.delete(:agent)
      @body  = @page ? @page.body : ""
    end

    def has_next?
      false
    end

    def last_page?
      !has_next?
    end

    def next_page
      raise NoNextPageAvailableError.new("Unimplemented, override Page#next_page")
    end

    class NoNextPageAvailableError < StandardError
    end

    protected
      AZN_DATE_FMT = "%m/%d/%y"
      def parse_amazon_time(string)
        Time.strptime(string, "#{AZN_DATE_FMT} %H:%M:%S")
      end

      def parse_amazon_date(string)
        Time.strptime(string, AZN_DATE_FMT)
      end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
amazon_seller_central-0.2.14 lib/amazon_seller_central/page.rb
amazon_seller_central-0.2.13 lib/amazon_seller_central/page.rb