Sha256: a3b54710bb93839c90ede3e2130fc85ad2ec26f4a04f3a66ea9f7cb2c8dc6d04

Contents?: true

Size: 512 Bytes

Versions: 5

Compression:

Stored size: 512 Bytes

Contents

module Imaginable
  
  class Image
    
    attr_accessor :uuid, :token
    
    def initialize(uuid, token, version)
      @uuid = uuid
      @token = token
      @version = version
    end
    
    def url(options = {})
      options[:width] ||= 0
      options[:format] ||= 'original'
      
      height = options.has_key?(:height) ? "-#{options[:height]}" : ""
      
      "#{Imaginable.scale_server}/image/#{@uuid}-#{@version}-#{options[:format]}-#{options[:width]}#{height}.jpg"
    end
    
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
imaginable-0.1.6 lib/imaginable/image.rb
imaginable-0.1.5 lib/imaginable/image.rb
imaginable-0.1.4 lib/imaginable/image.rb
imaginable-0.1.3 lib/imaginable/image.rb
imaginable-0.1.2 lib/imaginable/image.rb