Class: LinkShrink::Shrinkers::IsGd
- Defined in:
- lib/link_shrink/shrinkers/isgd.rb
Overview
Implements Is.gd Shortener API
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#api_query_parameter ⇒ String
URL query parameters.
-
#api_url ⇒ String
Returns full api url.
-
#base_url ⇒ String
Returns URL base for API.
-
#content_type ⇒ String
Returns Content-Type to be used in Request headers.
Methods inherited from Base
#api_key, #api_key?, #body_parameters, collection, error, #generate_chart_url, #http_method, inherited, response_options, #sanitize_url, short_url
Instance Method Details
#api_query_parameter ⇒ String
URL query parameters
14 15 16 |
# File 'lib/link_shrink/shrinkers/isgd.rb', line 14 def api_query_parameter "?format=simple&url=#{url}" end |
#api_url ⇒ String
Returns full api url
26 27 28 |
# File 'lib/link_shrink/shrinkers/isgd.rb', line 26 def api_url base_url.concat api_query_parameter end |
#base_url ⇒ String
Returns URL base for API
8 9 10 |
# File 'lib/link_shrink/shrinkers/isgd.rb', line 8 def base_url 'http://is.gd/create.php' end |
#content_type ⇒ String
Returns Content-Type to be used in Request headers
20 21 22 |
# File 'lib/link_shrink/shrinkers/isgd.rb', line 20 def content_type 'text/plain' end |