Class: Bard::Copy
- Inherits:
-
Object
- Object
- Bard::Copy
- Defined in:
- lib/bard/copy.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Class Method Summary collapse
- .dir(path, from:, to:, verbose: false) ⇒ Object
- .file(path, from:, to:, verbose: false) ⇒ Object
- .inherited(subclass) ⇒ Object
Instance Method Summary collapse
- #dir ⇒ Object
- #file ⇒ Object
-
#initialize(path, from, to, verbose) ⇒ Copy
constructor
A new instance of Copy.
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
#from ⇒ Object (readonly)
Returns the value of attribute from.
28 29 30 |
# File 'lib/bard/copy.rb', line 28 def from @from end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
28 29 30 |
# File 'lib/bard/copy.rb', line 28 def path @path end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
28 29 30 |
# File 'lib/bard/copy.rb', line 28 def to @to end |
#verbose ⇒ Object (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
#dir ⇒ Object
41 42 43 |
# File 'lib/bard/copy.rb', line 41 def dir raise NotImplementedError end |
#file ⇒ Object
37 38 39 |
# File 'lib/bard/copy.rb', line 37 def file raise NotImplementedError end |