Class: Exfuz::Status
- Inherits:
-
Object
- Object
- Exfuz::Status
- Defined in:
- lib/exfuz/status.rb
Instance Attribute Summary collapse
-
#loaded ⇒ Object
readonly
Returns the value of attribute loaded.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
Instance Method Summary collapse
- #finished? ⇒ Boolean
-
#initialize(max) ⇒ Status
constructor
A new instance of Status.
-
#to_s ⇒ Object
TODO: メソッド名を変更すること.
- #update(num) ⇒ Object
Constructor Details
#initialize(max) ⇒ Status
Returns a new instance of Status.
7 8 9 10 |
# File 'lib/exfuz/status.rb', line 7 def initialize(max) @loaded = 0 @max = max end |
Instance Attribute Details
#loaded ⇒ Object (readonly)
Returns the value of attribute loaded.
5 6 7 |
# File 'lib/exfuz/status.rb', line 5 def loaded @loaded end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
5 6 7 |
# File 'lib/exfuz/status.rb', line 5 def max @max end |
Instance Method Details
#finished? ⇒ Boolean
16 17 18 |
# File 'lib/exfuz/status.rb', line 16 def finished? @loaded == @max end |
#to_s ⇒ Object
TODO: メソッド名を変更すること
21 22 23 |
# File 'lib/exfuz/status.rb', line 21 def to_s "[#{@loaded}/#{@max}]" end |
#update(num) ⇒ Object
12 13 14 |
# File 'lib/exfuz/status.rb', line 12 def update(num) @loaded += num end |