Sha256: c0cc756147a7d422e518e3fcfea50739923c6d35ab05599fbd701265ae3dd65a

Contents?: true

Size: 282 Bytes

Versions: 6

Compression:

Stored size: 282 Bytes

Contents

module MethodCallbacks
  class Locker
    attr_accessor :state

    def initialize
      self.state = :unlocked
    end

    def lock!
      self.state = :locked
    end

    def locked?
      state == :locked
    end

    def unlock!
      self.state = :unlocked
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
method_callbacks-1.2.2 lib/method_callbacks/locker.rb
method_callbacks-1.2.1 lib/method_callbacks/locker.rb
method_callbacks-1.2.0 lib/method_callbacks/locker.rb
method_callbacks-1.1.1 lib/method_callbacks/locker.rb
method_callbacks-1.1.0 lib/method_callbacks/locker.rb
method_callbacks-1.0.0 lib/method_callbacks/locker.rb