Class: RsyncCron::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/rsync_cron/options.rb

Constant Summary collapse

BANDWITH_LIMIT =
5*1024
DEFAULT =
{ 
  rsh: "ssh",
  bwlimit: BANDWITH_LIMIT,
  exclude: "'DfsrPrivate'"
}
FLAGS =
%w[noatime verbose archive compress]

Instance Method Summary collapse

Constructor Details

#initialize(data: DEFAULT, flags: FLAGS) ⇒ Options

Returns a new instance of Options.



11
12
13
14
# File 'lib/rsync_cron/options.rb', line 11

def initialize(data: DEFAULT, flags: FLAGS)
  @data = data.to_h
  @flags = flags.to_a
end

Instance Method Details

#merge(opt) ⇒ Object



20
21
22
23
# File 'lib/rsync_cron/options.rb', line 20

def merge(opt)
  @data = @data.merge(opt)
  self
end

#to_sObject



16
17
18
# File 'lib/rsync_cron/options.rb', line 16

def to_s
  [flags, data].compact.join(" ")
end