Class: WebTranslateIt::Safe::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/web_translate_it/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.



9
10
11
12
# File 'lib/web_translate_it/safe/stream.rb', line 9

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

Instance Attribute Details

#backupObject

Returns the value of attribute backup.



7
8
9
# File 'lib/web_translate_it/safe/stream.rb', line 7

def backup
  @backup
end

#configObject

Returns the value of attribute config.



7
8
9
# File 'lib/web_translate_it/safe/stream.rb', line 7

def config
  @config
end

Instance Method Details

#expand(path) ⇒ Object

FIXME: move to Backup



15
16
17
18
19
20
# File 'lib/web_translate_it/safe/stream.rb', line 15

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