Class: JLDrill::Test::FileProgress

Inherits:
FileProgressContext::FileProgress show all
Defined in:
lib/jldrill/views/test/FileProgress.rb

Instance Attribute Summary collapse

Attributes inherited from Context::View

#context

Instance Method Summary collapse

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

#callsObject

Returns the value of attribute calls.



7
8
9
# File 'lib/jldrill/views/test/FileProgress.rb', line 7

def calls
  @calls
end

#fractionObject

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