Class: CpData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCpData

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

#fromObject (readonly)

Returns the value of attribute from.



4
5
6
# File 'lib/CpData.rb', line 4

def from
  @from
end

#modeObject (readonly)

Returns the value of attribute mode.



4
5
6
# File 'lib/CpData.rb', line 4

def mode
  @mode
end

#toObject (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