Class: AmazonSellerCentral::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon_seller_central/page.rb

Direct Known Subclasses

FeedbackPage, InventoryPage, OrdersPage, PaymentsPage

Defined Under Namespace

Classes: NoNextPageAvailableError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Page

Returns a new instance of Page.



5
6
7
8
9
# File 'lib/amazon_seller_central/page.rb', line 5

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/amazon_seller_central/page.rb', line 3

def body
  @body
end

Instance Method Details

#has_next?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/amazon_seller_central/page.rb', line 11

def has_next?
  false
end

#last_page?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/amazon_seller_central/page.rb', line 15

def last_page?
  !has_next?
end

#next_pageObject



19
20
21
# File 'lib/amazon_seller_central/page.rb', line 19

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