Class: WitBot::IntentMeta
- Inherits:
-
Object
- Object
- WitBot::IntentMeta
- Defined in:
- lib/wit_bot/models/wit/intent/intent_meta.rb
Instance Attribute Summary collapse
-
#states ⇒ Object
readonly
Returns the value of attribute states.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(states: []) ⇒ IntentMeta
constructor
A new instance of IntentMeta.
- #to_h ⇒ Object (also: #to_hash)
Constructor Details
#initialize(states: []) ⇒ IntentMeta
Returns a new instance of IntentMeta.
5 6 7 |
# File 'lib/wit_bot/models/wit/intent/intent_meta.rb', line 5 def initialize(states: []) @states = states.map{ |state| State.find state } end |
Instance Attribute Details
#states ⇒ Object (readonly)
Returns the value of attribute states.
3 4 5 |
# File 'lib/wit_bot/models/wit/intent/intent_meta.rb', line 3 def states @states end |
Class Method Details
.from_states(*states) ⇒ Object
9 10 11 |
# File 'lib/wit_bot/models/wit/intent/intent_meta.rb', line 9 def self.from_states(*states) self.new states: states end |
Instance Method Details
#to_h ⇒ Object Also known as: to_hash
13 14 15 |
# File 'lib/wit_bot/models/wit/intent/intent_meta.rb', line 13 def to_h {states: states} end |