lib/bulldog/processor/base.rb in bulldog-0.0.8 vs lib/bulldog/processor/base.rb in bulldog-0.0.9
- old
+ new
@@ -1,11 +1,10 @@
module Bulldog
module Processor
class Base
- def initialize(attachment, styles, input_file)
+ def initialize(attachment, input_file)
@attachment = attachment
- @styles = styles
@input_file = input_file
end
#
# The attachment object being processed.
@@ -59,19 +58,25 @@
# each style.
#
# #style will be set to the current style each time the block is
# called.
#
- def process(&block)
- return if styles.empty?
+ # Return true if any styles were processed, false otherwise.
+ # Subclasses can use this to determine if any processing
+ # commands need to be run.
+ #
+ def process(styles, options={}, &block)
+ @styles = styles
+ return false if styles.empty?
styles.each do |style|
@style = style
begin
process_style(&block)
ensure
@style = nil
end
end
+ true
end
#
# The current style being processed.
#