Class: Docman::IncrementalTagger

Inherits:
Taggers::Tagger show all
Defined in:
lib/docman/taggers/incremental_tagger.rb

Instance Attribute Summary

Attributes inherited from Command

#type

Instance Method Summary collapse

Methods inherited from Taggers::Tagger

create, #initialize, register_tagger

Methods inherited from Command

#add_action, #add_actions, #config, create, #describe, #initialize, #perform, #prefix, register_command, #replace_placeholder, #run_actions, #run_with_hooks

Methods included from Logging

#log, logger, #logger, #prefix, #properties_info, #with_logging

Constructor Details

This class inherits a constructor from Docman::Taggers::Tagger

Instance Method Details

#executeObject



8
9
10
11
12
13
14
# File 'lib/docman/taggers/incremental_tagger.rb', line 8

def execute
  version = self['prev_version'].nil? ? 0 : self['prev_version'].to_i
  version = 0 unless version.is_a? Integer
  version + 1
rescue
  1
end