Class: Astrails::Safe::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/astrails/safe/stream.rb

Direct Known Subclasses

Pipe, Sink, Source

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, backup) ⇒ Stream

Returns a new instance of Stream.



6
7
8
# File 'lib/astrails/safe/stream.rb', line 6

def initialize(config, backup)
  @config, @backup = config, backup
end

Instance Attribute Details

#backupObject

Returns the value of attribute backup.



5
6
7
# File 'lib/astrails/safe/stream.rb', line 5

def backup
  @backup
end

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/astrails/safe/stream.rb', line 5

def config
  @config
end

Instance Method Details

#expand(path) ⇒ Object

FIXME: move to Backup



11
12
13
14
15
16
# File 'lib/astrails/safe/stream.rb', line 11

def expand(path)
  path .
  gsub(/:kind\b/, @backup.kind.to_s) .
  gsub(/:id\b/, @backup.id.to_s) .
  gsub(/:timestamp\b/, @backup.timestamp)
end