moved the constants to the top
This commit is contained in:
parent
bb84940a7a
commit
7f2c4c1526
1 changed files with 14 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue