Module: NluAdapterIntentCollection
- Included in:
- NluAdapter::Adapters::Dialogflow::IntentCollection, NluAdapter::Adapters::Lex::IntentCollection
- Defined in:
- lib/nlu_adapter/intent_collection.rb
Overview
Class represents a collection of Intents
Instance Attribute Summary collapse
-
#intents ⇒ Object
Returns the value of attribute intents.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, intents) ⇒ Object
Constructor.
-
#to_h ⇒ Hash
Convert self to Hash.
-
#to_json ⇒ Json
Convert self to Json.
Instance Attribute Details
#intents ⇒ Object
Returns the value of attribute intents.
5 6 7 |
# File 'lib/nlu_adapter/intent_collection.rb', line 5 def intents @intents end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/nlu_adapter/intent_collection.rb', line 5 def name @name end |
Instance Method Details
#initialize(name, intents) ⇒ Object
Constructor
8 9 10 11 |
# File 'lib/nlu_adapter/intent_collection.rb', line 8 def initialize(name, intents) @name = name @intents = intents end |
#to_h ⇒ Hash
Convert self to Hash
16 17 18 19 20 21 |
# File 'lib/nlu_adapter/intent_collection.rb', line 16 def to_h { :name => @name, :intents => @intents.map { |i| i.to_h } } end |
#to_json ⇒ Json
Convert self to Json
26 27 28 |
# File 'lib/nlu_adapter/intent_collection.rb', line 26 def to_json to_h.to_json end |