Sha256: 33fda7df9ccd279d6df768cf06a07558620f983c7273b8fe38d40022f830fbab

Contents?: true

Size: 427 Bytes

Versions: 12

Compression:

Stored size: 427 Bytes

Contents

module Imgix
  module ParamHelpers
    def rect(position)
      @options[:rect] = position and return self if position.is_a?(String)

      @options[:rect] = [
        position[:x] || position[:left],
        position[:y] || position[:top],
        position[:width] || (position[:right] - position[:left]),
        position[:height] || (position[:bottom] - position[:top])
      ].join(',')

      return self
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
imgix-1.2.1 lib/imgix/param_helpers.rb
imgix-1.2.0 lib/imgix/param_helpers.rb
imgix-1.1.0 lib/imgix/param_helpers.rb
imgix-1.0.0 lib/imgix/param_helpers.rb
imgix-0.3.5 lib/imgix/param_helpers.rb
imgix-0.3.4 lib/imgix/param_helpers.rb
imgix-0.3.3 lib/imgix/param_helpers.rb
imgix-0.3.2 lib/imgix/param_helpers.rb
imgix-0.3.1 lib/imgix/param_helpers.rb
imgix-0.3.0 lib/imgix/param_helpers.rb
imgix-0.2.1 lib/imgix/param_helpers.rb
imgix-0.2.0 lib/imgix/param_helpers.rb