Class: WitBot::IntentMeta

Inherits:
Object
  • Object
show all
Defined in:
lib/wit_bot/models/wit/intent/intent_meta.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#statesObject (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_hObject 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