Class: BackupOrganizer::Pattern

Inherits:
Object
  • Object
show all
Defined in:
lib/backup_organizer/pattern.rb

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Pattern

Returns a new instance of Pattern.

Yields:

  • (_self)

Yield Parameters:



3
4
5
# File 'lib/backup_organizer/pattern.rb', line 3

def initialize
  yield self
end

Instance Method Details

#directoriesObject



13
14
15
# File 'lib/backup_organizer/pattern.rb', line 13

def directories
  rules.map &:directory
end

#rulesObject



17
18
19
# File 'lib/backup_organizer/pattern.rb', line 17

def rules
  @rules ||= []
end

#stored_in(directory) ⇒ Object



7
8
9
10
11
# File 'lib/backup_organizer/pattern.rb', line 7

def stored_in(directory)
  rule = Rule.new(directory)
  rules << rule
  rule
end