Class: EhbrsRubyUtils::CircularListSpreader::ItemLevel

Inherits:
Object
  • Object
show all
Includes:
BaseLevel
Defined in:
lib/ehbrs_ruby_utils/circular_list_spreader/item_level.rb

Instance Method Summary collapse

Methods included from BaseLevel

#<=>, #debugs, #remaining?, #remaining_f, #remaining_fs

Instance Method Details

#labelObject



15
16
17
# File 'lib/ehbrs_ruby_utils/circular_list_spreader/item_level.rb', line 15

def label
  item.to_s
end

#popObject



19
20
21
22
23
24
# File 'lib/ehbrs_ruby_utils/circular_list_spreader/item_level.rb', line 19

def pop
  raise 'Item already removed' if removed?

  self.removed = true
  self
end

#remaining_iObject



26
27
28
# File 'lib/ehbrs_ruby_utils/circular_list_spreader/item_level.rb', line 26

def remaining_i
  removed? ? 0 : 1
end

#removed?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/ehbrs_ruby_utils/circular_list_spreader/item_level.rb', line 30

def removed?
  @removed
end

#total_iObject



34
35
36
# File 'lib/ehbrs_ruby_utils/circular_list_spreader/item_level.rb', line 34

def total_i
  1
end