moved the constants to the top

This commit is contained in:
Brendan McDevitt 2020-02-04 23:45:07 -06:00
parent bb84940a7a
commit 7f2c4c1526

View file

@ -4,6 +4,17 @@
module Pastebinner
class ApiClient
# A hash of every endpoint that the Pastebinner::Api Client will use
ENDPOINTS =
{
login: '/api_login.php',
post: '/api_post.php',
raw: '/api_raw.php',
scraping: '/api_scraping.php',
scrape_item: '/api_scrape_item.php',
scrape_item_meta: '/api_scrape_item_meta.php'
}.freeze
# The pastebin pro api developer key
# @return [String] '123456789'
attr_accessor :api_dev_key
@ -30,17 +41,6 @@ module Pastebinner
@scraping_api_url = 'https://scrape.pastebin.com'
end
# A hash of every endpoint that the Pastebinner::Api Client will use
ENDPOINTS =
{
login: '/api_login.php',
post: '/api_post.php',
raw: '/api_raw.php',
scraping: '/api_scraping.php',
scrape_item: '/api_scrape_item.php',
scrape_item_meta: '/api_scrape_item_meta.php'
}.freeze
# @param api_dev_key [String] Required: Your unique developer api key
# @param api_option [String] Required: Set as paste, this will indicate you want to create a new paste
# @param api_paste_code [String] Required: This is the text that will be written inside of your paste
@ -97,6 +97,9 @@ module Pastebinner
execute_query(:api_post, params)
end
# A hash of the api token
def get_user_info
params = { 'api_dev_key': api_dev_key }
end