module Bitly
Bitly
module.
Constants
- VERSION
Public Class Methods
shorten(long_url, options = {})
click to toggle source
# File lib/bitly.rb, line 11 def self.shorten(long_url, options = {}) client.shorten(long_url, options) end
Private Class Methods
client()
click to toggle source
# File lib/bitly.rb, line 18 def client validate! Bitly::V4::Client.new(access_token: access_token) end
validate!()
click to toggle source
# File lib/bitly.rb, line 23 def validate! raise StandardError, 'please set api_version.' unless api_version raise StandardError, "#{api_version} is not supported." unless api_version == 'v4' raise StandardError, 'please set access_token.' unless access_token end