Sha256: 2f3badf0bc192fba7a152c3a5d11b56b25edcbb4a39d8c6a6c3c985911836169

Contents?: true

Size: 301 Bytes

Versions: 13

Compression:

Stored size: 301 Bytes

Contents

class StateHistory
  attr_reader :hx_size_limit

  def initialize(hx_size_limit: 10)
    @hx_size_limit = hx_size_limit
    @container = []
  end

  def <<(state_symbol)
    @container << state_symbol
    @container = @container.last(hx_size_limit)
    self
  end

  def list
    @container
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
simplestate-2.0.14 lib/simplestate/state_history.rb
simplestate-2.0.13 lib/simplestate/state_history.rb
simplestate-2.0.12 lib/simplestate/state_history.rb
simplestate-2.0.11 lib/simplestate/state_history.rb
simplestate-2.0.10 lib/simplestate/state_history.rb
simplestate-2.0.9 lib/simplestate/state_history.rb
simplestate-2.0.8 lib/simplestate/state_history.rb
simplestate-2.0.7 lib/simplestate/state_history.rb
simplestate-2.0.6 lib/simplestate/state_history.rb
simplestate-2.0.5 lib/simplestate/state_history.rb
simplestate-2.0.4 lib/simplestate/state_history.rb
simplestate-2.0.3 lib/simplestate/state_history.rb
simplestate-2.0.2 lib/simplestate/state_history.rb