Class: CpData
- Inherits:
-
Object
- Object
- CpData
- Defined in:
- lib/CpData.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize ⇒ CpData
constructor
A new instance of CpData.
- #setFrom(f) ⇒ Object
- #setMode(m) ⇒ Object
- #setTo(t) ⇒ Object
Constructor Details
#initialize ⇒ CpData
Returns a new instance of CpData.
6 7 8 9 10 |
# File 'lib/CpData.rb', line 6 def initialize from = String.new to = String.new mode = -1 end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
4 5 6 |
# File 'lib/CpData.rb', line 4 def from @from end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
4 5 6 |
# File 'lib/CpData.rb', line 4 def mode @mode end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
4 5 6 |
# File 'lib/CpData.rb', line 4 def to @to end |
Instance Method Details
#setFrom(f) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/CpData.rb', line 12 def setFrom(f) begin r = File::ftype(f) rescue Errno::ENOENT => e STDERR.puts "No such directory. #{f}" else if r == "directory" then @from = f else puts "#{f} is not directory." end end end |
#setMode(m) ⇒ Object
30 31 32 |
# File 'lib/CpData.rb', line 30 def setMode(m) @mode = m end |
#setTo(t) ⇒ Object
26 27 28 |
# File 'lib/CpData.rb', line 26 def setTo(t) @to = t end |