Class: ToolObject
- Inherits:
-
Object
- Object
- ToolObject
- Defined in:
- lib/toolman/toolobject.rb
Instance Method Summary collapse
- #color_list ⇒ Object
- #done ⇒ Object
-
#initialize ⇒ ToolObject
constructor
A new instance of ToolObject.
- #loading_bar(nowPoint, endPoint) ⇒ Object
- #puts ⇒ Object
- #say(data) ⇒ Object
Constructor Details
#initialize ⇒ ToolObject
Returns a new instance of ToolObject.
3 4 5 6 7 8 |
# File 'lib/toolman/toolobject.rb', line 3 def initialize @tempPoint = 0 @circle = [">",">>",">>>",">>>>"," >>>"," >>"," >"," "] @circleSize = @circle.size @colorMechine = Color.new end |
Instance Method Details
#color_list ⇒ Object
34 35 36 |
# File 'lib/toolman/toolobject.rb', line 34 def color_list @colorMechine.color_list end |
#done ⇒ Object
30 31 32 |
# File 'lib/toolman/toolobject.rb', line 30 def done self.puts.green! "\n=============================\n Done!\n Every thing is good!\n=============================\n" end |
#loading_bar(nowPoint, endPoint) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/toolman/toolobject.rb', line 18 def (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 |
#puts ⇒ Object
26 27 28 |
# File 'lib/toolman/toolobject.rb', line 26 def puts @colorMechine end |
#say(data) ⇒ Object
12 13 14 15 16 |
# File 'lib/toolman/toolobject.rb', line 12 def say(data) puts "\n>>>>>>>>>>>>>>>>>Messange>>>>>>>>>>>>>>>>>" puts "#{data}" puts ">>>>>>>>>>>>>>>>>Messange>>>>>>>>>>>>>>>>>\n" end |