Class: JLDrill::Test::FileProgress
- Inherits:
-
FileProgressContext::FileProgress
- Object
- Context::View
- FileProgressContext::FileProgress
- JLDrill::Test::FileProgress
- Defined in:
- lib/jldrill/views/test/FileProgress.rb
Instance Attribute Summary collapse
-
#calls ⇒ Object
Returns the value of attribute calls.
-
#fraction ⇒ Object
Returns the value of attribute fraction.
Attributes inherited from Context::View
Instance Method Summary collapse
- #idle_add(&block) ⇒ Object
-
#initialize(context) ⇒ FileProgress
constructor
A new instance of FileProgress.
- #update(fraction) ⇒ Object
Methods inherited from Context::View
#addView, #getWidget, #removeView, #removingViewFrom, #viewAddedTo
Constructor Details
#initialize(context) ⇒ FileProgress
Returns a new instance of FileProgress.
10 11 12 13 14 |
# File 'lib/jldrill/views/test/FileProgress.rb', line 10 def initialize(context) super(context) @fraction = 0 @calls = 0 end |
Instance Attribute Details
#calls ⇒ Object
Returns the value of attribute calls.
7 8 9 |
# File 'lib/jldrill/views/test/FileProgress.rb', line 7 def calls @calls end |
#fraction ⇒ Object
Returns the value of attribute fraction.
7 8 9 |
# File 'lib/jldrill/views/test/FileProgress.rb', line 7 def fraction @fraction end |
Instance Method Details
#idle_add(&block) ⇒ Object
20 21 22 23 24 |
# File 'lib/jldrill/views/test/FileProgress.rb', line 20 def idle_add(&block) while !block.call @calls += 1 end end |
#update(fraction) ⇒ Object
16 17 18 |
# File 'lib/jldrill/views/test/FileProgress.rb', line 16 def update(fraction) @fraction = fraction end |