Class: Fairy::CIotaPlace
- Inherits:
-
Object
- Object
- Fairy::CIotaPlace
- Defined in:
- lib/fairy/share/file-place.rb
Instance Method Summary collapse
- #each_assigned_filter(&block) ⇒ Object
-
#initialize(last, offset, split_no) ⇒ CIotaPlace
constructor
A new instance of CIotaPlace.
Constructor Details
#initialize(last, offset, split_no) ⇒ CIotaPlace
Returns a new instance of CIotaPlace.
122 123 124 125 126 |
# File 'lib/fairy/share/file-place.rb', line 122 def initialize(last, offset, split_no) @last = last @offset = offset @split_no = split_no end |
Instance Method Details
#each_assigned_filter(&block) ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/fairy/share/file-place.rb', line 128 def each_assigned_filter(&block) first = @offset no = -1 @split_no.times do no += 1 Log::debug self, "NO: #{no}" last = [first + @last.div(@split_no), @last].min block.call PIotaPlace.new(no, first, last) first = last + 1 break if first > @last end # sleep 0.1 end |