From 7f2c4c152646cf9a94c1d07cd2e4034c1d5314cc Mon Sep 17 00:00:00 2001 From: bpmcdevitt Date: Tue, 4 Feb 2020 23:45:07 -0600 Subject: [PATCH] moved the constants to the top --- lib/pastebinner/api_client.rb | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/pastebinner/api_client.rb b/lib/pastebinner/api_client.rb index 98ae8ca..48e8d07 100644 --- a/lib/pastebinner/api_client.rb +++ b/lib/pastebinner/api_client.rb @@ -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 @@ -29,17 +40,6 @@ module Pastebinner @base_api_url = 'https://pastebin.com/api' @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 @@ -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