Class: Avm::Git::AutoCommit::Rules::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/git/auto_commit/rules/base.rb

Direct Known Subclasses

Last, Manual, New, Nth, Unique

Defined Under Namespace

Classes: WithFile

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.keysObject



11
12
13
# File 'lib/avm/git/auto_commit/rules/base.rb', line 11

def keys
  [long_key, short_key]
end

.long_keyObject



15
16
17
# File 'lib/avm/git/auto_commit/rules/base.rb', line 15

def long_key
  name.demodulize.variableize
end

.short_keyObject



19
20
21
# File 'lib/avm/git/auto_commit/rules/base.rb', line 19

def short_key
  long_key[0, 1]
end

Instance Method Details

#with_file(file) ⇒ Object



24
25
26
# File 'lib/avm/git/auto_commit/rules/base.rb', line 24

def with_file(file)
  self.class.const_get('WithFile').new(self, file)
end