Class: S3Search::ResultPage
- Inherits:
-
Object
- Object
- S3Search::ResultPage
show all
- Defined in:
- lib/s3search/result_page.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(response, client) ⇒ ResultPage
Returns a new instance of ResultPage.
6
7
8
9
10
|
# File 'lib/s3search/result_page.rb', line 6
def initialize response, client
@response = response
@results = response.results
@client = client
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
42
43
44
45
46
47
48
49
50
|
# File 'lib/s3search/result_page.rb', line 42
def method_missing method_name, *args, &block
if results.respond_to?(method_name)
results.send method_name, *args, &block
elsif response.respond_to?(method_name)
response.send method_name, *args, &block
else
super
end
end
|
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
4
5
6
|
# File 'lib/s3search/result_page.rb', line 4
def response
@response
end
|
#results ⇒ Object
Returns the value of attribute results.
4
5
6
|
# File 'lib/s3search/result_page.rb', line 4
def results
@results
end
|
Instance Method Details
#next ⇒ Object
12
13
14
15
|
# File 'lib/s3search/result_page.rb', line 12
def next
return unless next?
change_page(links.next)
end
|
#next? ⇒ Boolean
17
18
19
|
# File 'lib/s3search/result_page.rb', line 17
def next?
links.next
end
|
#prev ⇒ Object
21
22
23
24
|
# File 'lib/s3search/result_page.rb', line 21
def prev
return unless prev?
change_page(links.prev)
end
|
#prev? ⇒ Boolean
26
27
28
|
# File 'lib/s3search/result_page.rb', line 26
def prev?
links.prev
end
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
30
31
32
|
# File 'lib/s3search/result_page.rb', line 30
def respond_to_missing? method_name, include_private=false
results.respond_to?(method_name, include_private) || response.respond_to?(method_name, include_private)
end
|