Class: BackupOrganizer::Rule
- Inherits:
-
Object
- Object
- BackupOrganizer::Rule
- Defined in:
- lib/backup_organizer/rule.rb
Instance Method Summary collapse
- #applies_for?(file) ⇒ Boolean
- #directory ⇒ Object
- #if(&rule) ⇒ Object
-
#initialize(directory) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(directory) ⇒ Rule
Returns a new instance of Rule.
3 4 5 |
# File 'lib/backup_organizer/rule.rb', line 3 def initialize(directory) @directory = directory end |
Instance Method Details
#applies_for?(file) ⇒ Boolean
11 12 13 14 |
# File 'lib/backup_organizer/rule.rb', line 11 def applies_for?(file) file.extend(Extensions::FileExtensions) @rule.call(file) end |
#directory ⇒ Object
16 17 18 |
# File 'lib/backup_organizer/rule.rb', line 16 def directory @directory end |
#if(&rule) ⇒ Object
7 8 9 |
# File 'lib/backup_organizer/rule.rb', line 7 def if(&rule) @rule = rule end |