scaleflex / cloudimage-rb

Official Ruby API wrapper for Cloudimage's API. Any questions or issues, please report to https://github.com/scaleflex/cloudimage-rb/issues
Other
4 stars 1 forks source link

Add default alias #26

Closed janklimo closed 4 years ago

janklimo commented 4 years ago

You don't need to specify an alias if the input to path is a URL that already matches the base of the generated URL:

client = Cloudimage::Client.new(token: 'token')
client.path('https://token.cloudimg.io/v7/image.jpg').to_url(w: 200)
=> "https://token.cloudimg.io/v7/image.jpg?w=200"

Closes #22