Class: Toolman::ToolObject

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

Instance Method Summary collapse

Constructor Details

#initializeToolObject

Returns a new instance of ToolObject.



33
34
35
36
37
38
# File 'lib/toolman.rb', line 33

def initialize
	@tempPoint = 0 
	@circle = [">",">>",">>>",">>>>"," >>>","  >>","   >","    "]
	@circleSize = @circle.size
	@colorMechine = Color.new
end

Instance Method Details

#loading_bar(nowPoint, endPoint) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/toolman.rb', line 48

def loading_bar(nowPoint,endPoint)
	p = (( (nowPoint*1.0) / endPoint) * 100).floor
	print "\r"
	print "                                                  \r"
	print "%5d%-3s%-5s%-3s" % [p,"%","#{@circle[@tempPoint]}",""]
	@tempPoint = (@tempPoint + 1) % @circleSize
end

#putsObject



56
57
58
# File 'lib/toolman.rb', line 56

def puts
	@colorMechine
end

#say(data) ⇒ Object



42
43
44
45
46
# File 'lib/toolman.rb', line 42

def say(data)
	puts "\n>>>>>>>>>>>>>>>>>Messange>>>>>>>>>>>>>>>>>"
	puts "#{data}"
	puts ">>>>>>>>>>>>>>>>>Messange>>>>>>>>>>>>>>>>>\n"
end