Class: Sphyg::Enumerators::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/sphyg/enumerators/base.rb

Overview

Enumerator template

Direct Known Subclasses

Cycle, Rotate

Defined Under Namespace

Classes: AbstractMethodCall

Instance Method Summary collapse

Constructor Details

#initialize(frames) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/sphyg/enumerators/base.rb', line 7

def initialize(frames)
  @frames = frames
end

Instance Method Details

#nextObject

‘next` is called at each iteration of a throbber’s existance. It returns the throbber state to display. For example, simply looping a given array is implemented in ‘Enumerators::Cycle’.

Raises:



14
15
16
# File 'lib/sphyg/enumerators/base.rb', line 14

def next
  raise AbstractMethodCall, 'Implement :run in a child class'
end