Class: Attach::Processor
- Inherits:
-
Object
- Object
- Attach::Processor
- Defined in:
- lib/attach/processor.rb
Class Attribute Summary collapse
-
.background_block ⇒ Object
readonly
Returns the value of attribute background_block.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attachment) ⇒ Processor
constructor
A new instance of Processor.
- #process ⇒ Object
- #queue_or_process ⇒ Object
Constructor Details
#initialize(attachment) ⇒ Processor
Returns a new instance of Processor.
15 16 17 |
# File 'lib/attach/processor.rb', line 15 def initialize() = end |
Class Attribute Details
.background_block ⇒ Object (readonly)
Returns the value of attribute background_block.
8 9 10 |
# File 'lib/attach/processor.rb', line 8 def background_block @background_block end |
Class Method Details
.background(&block) ⇒ Object
10 11 12 |
# File 'lib/attach/processor.rb', line 10 def background(&block) @background_block = block end |
Instance Method Details
#process ⇒ Object
19 20 21 22 |
# File 'lib/attach/processor.rb', line 19 def process call_processors mark_as_processed end |
#queue_or_process ⇒ Object
24 25 26 27 28 |
# File 'lib/attach/processor.rb', line 24 def queue_or_process return self.class.background_block.call() if self.class.background_block process end |