Module: Tap::App::State

Defined in:
lib/tap/app.rb

Overview

The constants defining the possible App states.

Constant Summary collapse

READY =
0
RUN =
1
STOP =
2
TERMINATE =
3

Class Method Summary collapse

Class Method Details

.state_str(state) ⇒ Object

Returns the string corresponding to the input state value.

Returns nil for unknown states.

State.state_str(0)        # => 'READY'
State.state_str(12)       # => nil


196
197
198
# File 'lib/tap/app.rb', line 196

def state_str(state)
  constants.inject(nil) {|str, s| const_get(s) == state ? s.to_s : str}
end