-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
177 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'hashie' | ||
require 'tankard/api/utils/find' | ||
|
||
module Tankard | ||
module Api | ||
module Base | ||
# Base class for routes that can find a specific type of data | ||
# | ||
# @author Matthew Shafer | ||
class Find | ||
include Tankard::Api::Utils::Find | ||
|
||
def initialize(request, options = {}) | ||
@http_client = request | ||
@http_request_parameters = Hashie::Mash.new(options) | ||
end | ||
|
||
private | ||
|
||
attr_reader :http_client, :http_request_parameters | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require 'hashie' | ||
require 'tankard/api/utils/page_finders' | ||
|
||
module Tankard | ||
module Api | ||
module Base | ||
# Base class for routes that can look up data across pages | ||
# | ||
# @author Matthew Shafer | ||
class PageFinders | ||
include Tankard::Api::Utils::PageFinders | ||
|
||
def initialize(request, options = {}) | ||
@http_client = request | ||
@http_request_parameters = Hashie::Mash.new(options) | ||
end | ||
|
||
def page(number) | ||
@http_request_parameters.p = number | ||
self | ||
end | ||
|
||
def params(options = {}) | ||
options.each_pair do |key, value| | ||
@http_request_parameters[key] = value | ||
end | ||
self | ||
end | ||
|
||
private | ||
|
||
attr_reader :http_client, :http_request_parameters | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.