Class: Imagga::ResolutionParametizer

Inherits:
Object
  • Object
show all
Includes:
Parametizer
Defined in:
lib/imagga/resolution_parametizer.rb

Instance Method Summary collapse

Methods included from Parametizer

#build_boolean_options, #build_comma_separated_string

Instance Method Details

#build_resolution_string(resolution) ⇒ Object



13
14
15
# File 'lib/imagga/resolution_parametizer.rb', line 13

def build_resolution_string(resolution)
  resolution.gsub('x', ',')
end

#build_resolutions(resolution_array_or_string) ⇒ Object



9
10
11
# File 'lib/imagga/resolution_parametizer.rb', line 9

def build_resolutions(resolution_array_or_string)
  [resolution_array_or_string].flatten.map{ |o| build_resolution_string(o) rescue o }.join(',')
end

#parametrize(resolution_array_or_string) ⇒ Object



5
6
7
# File 'lib/imagga/resolution_parametizer.rb', line 5

def parametrize(resolution_array_or_string)
  { resolutions: build_resolutions(resolution_array_or_string) }
end