Class: WitBot::IntentExpressions

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

Instance Method Summary collapse

Constructor Details

#initialize(intent, *expressions) ⇒ IntentExpressions

Returns a new instance of IntentExpressions.



3
4
5
6
# File 'lib/wit_bot/models/wit/intent/intent_expressions.rb', line 3

def initialize(intent, *expressions)
  @intent = intent
  super expressions.flatten!.map{|i| Expression.new @intent, i}
end

Instance Method Details

#create(body, request: true) ⇒ Object



8
9
10
# File 'lib/wit_bot/models/wit/intent/intent_expressions.rb', line 8

def create(body, request: true)
  self << Expression.new(@intent, body, request: request)
end