Class: LinkShrink::Shrinkers::Owly
- Defined in:
- lib/link_shrink/shrinkers/owly.rb
Overview
Implements Owly’s URL Shortener API
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#api_query_parameter ⇒ String
Returns URL query parameters.
-
#api_url ⇒ String
Returns full api url.
-
#base_url ⇒ String
Returns URL base for API.
Methods inherited from Base
#api_key, #api_key?, #body_parameters, collection, #content_type, error, #generate_chart_url, #http_method, inherited, response_options, #sanitize_url, short_url
Instance Method Details
#api_query_parameter ⇒ String
Returns URL query parameters
23 24 25 |
# File 'lib/link_shrink/shrinkers/owly.rb', line 23 def api_query_parameter "?apiKey=#{api_key}&longUrl=#{url}" end |
#api_url ⇒ String
Returns full api url
29 30 31 |
# File 'lib/link_shrink/shrinkers/owly.rb', line 29 def api_url base_url.concat api_query_parameter end |
#base_url ⇒ String
Returns URL base for API
17 18 19 |
# File 'lib/link_shrink/shrinkers/owly.rb', line 17 def base_url 'http://ow.ly/api/1.1/url/shorten' end |