class MicrosoftComputerVision::Api::Thumbnail

Constants

ENDPOINT

Public Class Methods

new(width, height, smart_cropping) click to toggle source
# File lib/microsoft_computer_vision/api/thumbnail.rb, line 8
def initialize(width, height, smart_cropping)
  @width = width
  @height = height
  @smart_cropping = smart_cropping
end

Public Instance Methods

params() click to toggle source
# File lib/microsoft_computer_vision/api/thumbnail.rb, line 21
def params
  data = {}
  data[:width] = @width unless @width.nil?
  data[:height] = @height unless @height.nil?
  data[:smartCropping] = @smart_cropping unless @smart_cropping.nil?

  data
end
uri(api_base_url) click to toggle source
# File lib/microsoft_computer_vision/api/thumbnail.rb, line 14
def uri(api_base_url)
  uri = URI("#{api_base_url}#{ENDPOINT}")
  uri.query = URI.encode_www_form(params)

  uri
end