Class: WitBot::State
- Inherits:
-
Object
- Object
- WitBot::State
- Defined in:
- lib/wit_bot/models/state.rb
Constant Summary collapse
- @@states =
{}
Instance Attribute Summary collapse
-
#state ⇒ Object
(also: #to_s, #as_json)
readonly
Returns the value of attribute state.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(state) ⇒ State
constructor
A new instance of State.
Constructor Details
#initialize(state) ⇒ State
Returns a new instance of State.
8 9 10 |
# File 'lib/wit_bot/models/state.rb', line 8 def initialize(state) @state = state end |
Instance Attribute Details
#state ⇒ Object (readonly) Also known as: to_s, as_json
Returns the value of attribute state.
4 5 6 |
# File 'lib/wit_bot/models/state.rb', line 4 def state @state end |
Class Method Details
.all ⇒ Object
16 17 18 |
# File 'lib/wit_bot/models/state.rb', line 16 def self.all @@states.values end |
.find(state) ⇒ Object
12 13 14 |
# File 'lib/wit_bot/models/state.rb', line 12 def self.find(state) @@states[state] ||= State.new(state) end |