Module: TransformUtils

Included in:
Transform
Defined in:
lib/filestack/utils/utils.rb

Overview

Utility functions for transformations

Instance Method Summary collapse

Instance Method Details

#add_transform_task(transform, options = {}) ⇒ String

Creates a transformation task to be sent back to transform object

Parameters:

  • transform (String)

    The task to be added

  • options (Dict) (defaults to: {})

    A dictionary representing the options for that task

Returns:

  • (String)


136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/filestack/utils/utils.rb', line 136

def add_transform_task(transform, options = {})
  options_list = []
  if !options.empty?
    options.each do |key, array|
      options_list.push("#{key}:#{array}")
    end
    options_string = options_list.join(',')
    "#{transform}=#{options_string}"
  else
    transform.to_s
  end
end