Class: Sprinkle::Commands::Transfer

Inherits:
Command show all
Defined in:
lib/sprinkle/commands/transfer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#string, #sudo?

Constructor Details

#initialize(source, destination, opts = {}) ⇒ Transfer

Returns a new instance of Transfer.



7
8
9
10
11
# File 'lib/sprinkle/commands/transfer.rb', line 7

def initialize(source, destination, opts={})
  @source = source
  @destination = destination
  @opts = opts
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



5
6
7
# File 'lib/sprinkle/commands/transfer.rb', line 5

def destination
  @destination
end

#optsObject (readonly)

Returns the value of attribute opts.



5
6
7
# File 'lib/sprinkle/commands/transfer.rb', line 5

def opts
  @opts
end

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/sprinkle/commands/transfer.rb', line 5

def source
  @source
end

Instance Method Details

#eql?(a, b) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
25
# File 'lib/sprinkle/commands/transfer.rb', line 21

def eql?(a,b)
  a.source == b.source &&
  a.destionation == b.destination &&
  a.opts == b.opts
end

#inspectObject



17
18
19
# File 'lib/sprinkle/commands/transfer.rb', line 17

def inspect
  ":TRANSFER, src: #{source}, dest: #{destination}, opts: #{@opts.inspect}"
end

#recursive?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/sprinkle/commands/transfer.rb', line 13

def recursive?
  !!@opts[:recursive]
end