Class: URI::Paged

Inherits:
Object
  • Object
show all
Defined in:
lib/w-stdlib/uri.rb

Instance Method Summary collapse

Constructor Details

#initialize(url, start = 1, name = 'page') ⇒ Paged

Returns a new instance of Paged.



4
5
6
7
8
# File 'lib/w-stdlib/uri.rb', line 4

def initialize(url, start=1, name='page')
  @url = url
  @start = start
  @name = name
end

Instance Method Details

#getObject



10
11
12
13
14
# File 'lib/w-stdlib/uri.rb', line 10

def get
  @url.with_query_params { _1[@name] = @start }
  @start += 1
  @url
end