Class: Bard::Copy

Inherits:
Object
  • Object
show all
Defined in:
lib/bard/copy.rb

Direct Known Subclasses

SSH::Copy

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, from, to, verbose) ⇒ Copy

Returns a new instance of Copy.



30
31
32
33
34
35
# File 'lib/bard/copy.rb', line 30

def initialize(path, from, to, verbose)
  @path = path
  @from = from
  @to = to
  @verbose = verbose
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



28
29
30
# File 'lib/bard/copy.rb', line 28

def from
  @from
end

#pathObject (readonly)

Returns the value of attribute path.



28
29
30
# File 'lib/bard/copy.rb', line 28

def path
  @path
end

#toObject (readonly)

Returns the value of attribute to.



28
29
30
# File 'lib/bard/copy.rb', line 28

def to
  @to
end

#verboseObject (readonly)

Returns the value of attribute verbose.



28
29
30
# File 'lib/bard/copy.rb', line 28

def verbose
  @verbose
end

Class Method Details

.dir(path, from:, to:, verbose: false) ⇒ Object



15
16
17
# File 'lib/bard/copy.rb', line 15

def dir(path, from:, to:, verbose: false)
  handler_for!(from, to).new(path, from, to, verbose).dir
end

.file(path, from:, to:, verbose: false) ⇒ Object



11
12
13
# File 'lib/bard/copy.rb', line 11

def file(path, from:, to:, verbose: false)
  handler_for!(from, to).new(path, from, to, verbose).file
end

.inherited(subclass) ⇒ Object



6
7
8
9
# File 'lib/bard/copy.rb', line 6

def inherited(subclass)
  super
  @handlers.unshift(subclass)
end

Instance Method Details

#dirObject

Raises:

  • (NotImplementedError)


41
42
43
# File 'lib/bard/copy.rb', line 41

def dir
  raise NotImplementedError
end

#fileObject

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/bard/copy.rb', line 37

def file
  raise NotImplementedError
end