Class: RsyncCron::Options
- Inherits:
-
Object
- Object
- RsyncCron::Options
- Defined in:
- lib/rsync_cron/options.rb
Constant Summary collapse
- BANDWITH_LIMIT =
5*1024
- DEFAULT =
{ rsh: "ssh", bwlimit: BANDWITH_LIMIT, exclude: "'DfsrPrivate'" }
- FLAGS =
%w[v r t z p L]
Instance Method Summary collapse
-
#initialize(data: DEFAULT, flags: FLAGS) ⇒ Options
constructor
A new instance of Options.
- #merge(opt) ⇒ Object
- #to_s ⇒ Object
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_s ⇒ Object
16 17 18 |
# File 'lib/rsync_cron/options.rb', line 16 def to_s [flags, data].compact.join(" ") end |