Module: Denko::Behaviors::State

Included in:
Callbacks, Component
Defined in:
lib/denko/behaviors/state.rb

Instance Method Summary collapse

Instance Method Details

#initialize(options = {}) ⇒ Object



4
5
6
7
8
# File 'lib/denko/behaviors/state.rb', line 4

def initialize(options={})
  # Component includes State, so no need to call super here.
  @state_mutex = Mutex.new
  @state = nil
end

#stateObject



10
11
12
# File 'lib/denko/behaviors/state.rb', line 10

def state
  @state_mutex.synchronize { @state }
end