Class: Wit::REST::EntityArray
- Inherits:
-
Object
- Object
- Wit::REST::EntityArray
- Defined in:
- lib/wit_ruby/rest/entity.rb
Overview
Internal wrapper for multiple entities for a given result.
Instance Method Summary collapse
-
#[](num) ⇒ Object
Allow for index calls to the specific intents in the instance.
-
#initialize(resultData) ⇒ Wit::REST::MultiEntity
constructor
Creates an instance that holds array of intents.
Constructor Details
#initialize(resultData) ⇒ Wit::REST::MultiEntity
Creates an instance that holds array of intents.
18 19 20 21 22 23 24 25 |
# File 'lib/wit_ruby/rest/entity.rb', line 18 def initialize(resultData) entity_arr = Array.new resultData.each do |entity| entity_arr << Entity.new(entity) end @entities = entity_arr end |
Instance Method Details
#[](num) ⇒ Object
Allow for index calls to the specific intents in the instance.
30 31 32 |
# File 'lib/wit_ruby/rest/entity.rb', line 30 def [](num) @entities[num] end |