Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Refactors effects helper.
Browse files Browse the repository at this point in the history
Testing viability of splitting out every effect to its own method.
  • Loading branch information
joegatt committed Mar 12, 2013
1 parent 80cf24e commit 2831de1
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions app/helpers/effects_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,34 @@ module EffectsHelper
def pre_fx(image, effects)
# Any effect that affects the size of the image goes here

transpose(image, effects)
transverse(image, effects)
trim(image, effects)
image
end

def transpose(image, effects)
# Rotate left

if effects =~ /lef/
# Rotate left
image = image.transpose
end
image
end

def transverse(image, effects)
# Rotate right

if effects =~ /rig/
# Rotate right
image = image.transverse
end
image
end

def trim(image, effects)
if effects =~ /tri/
image = image.trim
end

image
end

Expand Down

0 comments on commit 2831de1

Please sign in to comment.