Class: BlockedTags
- Inherits:
-
Object
- Object
- BlockedTags
- Includes:
- Logging
- Defined in:
- lib/flickrup/ext/blocked_tags.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ BlockedTags
constructor
A new instance of BlockedTags.
- #preupload(ctx) ⇒ Object
Methods included from Logging
Constructor Details
#initialize(config) ⇒ BlockedTags
Returns a new instance of BlockedTags.
4 5 6 |
# File 'lib/flickrup/ext/blocked_tags.rb', line 4 def initialize(config) @config = config end |
Instance Method Details
#preupload(ctx) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flickrup/ext/blocked_tags.rb', line 8 def preupload(ctx) blockers = @config[:blocked_tags] if blockers != nil blockers.each do |tag_name, tag_value| if ctx.file[tag_name] == tag_value #block logger.info("Blocking upload on #{ctx.properties[:filename]} as #{tag_name}=#{tag_value}") return nil end end end ctx end |