Sha256: f84b4f6267640c4666c859ced259cc67aa132877ac596344baa5d8284f77ddf9

Contents?: true

Size: 335 Bytes

Versions: 3

Compression:

Stored size: 335 Bytes

Contents

module BigMachine
  module Lock
    extend ActiveSupport::Concern

    included do
    end

    def locked?
      @locked
    end

    def enter
      @locked = true
    end

    def unlock
      @locked = false
    end

    def transition_to(state_class)
      return if @locked

      super
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
big_machine-1.1.0 lib/big_machine/lock.rb
big_machine-1.0.1 lib/big_machine/lock.rb
big_machine-1.0.0 lib/big_machine/lock.rb