Class: Wit::REST::MultiEntity
- Defined in:
- lib/wit_ruby/rest/entity.rb
Overview
Propagate these methods into Result
Wrapper for array of entities as strings. Inherits from Results so it can be refreshed.
Instance Method Summary collapse
-
#[](num) ⇒ Wit::REST::Result
Overide that assists in calling the proper index in the array of entity strings.
-
#each ⇒ String
Assists in going through each entity string in the instance variable.
-
#initialize(resultData, requestRest = nil, requestPath = nil, requestBody = nil) ⇒ Wit::REST::MultiIntent
constructor
Generates instance variable that holds list of entities as strings in array.
Methods inherited from Result
#empty?, #entities, #method_missing, #raw_data, #refreshable?, #restBody, #restCode, #restPath
Constructor Details
#initialize(resultData, requestRest = nil, requestPath = nil, requestBody = nil) ⇒ Wit::REST::MultiIntent
Generates instance variable that holds list of entities as strings in array.
48 49 50 51 52 |
# File 'lib/wit_ruby/rest/entity.rb', line 48 def initialize(resultData, requestRest=nil, requestPath=nil, requestBody=nil) ## Pass in empty hash to default to method missing for everything not defined here. super({}, requestRest, requestPath, requestBody) @entities = resultData end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Wit::REST::Result
Instance Method Details
#[](num) ⇒ Wit::REST::Result
Overide that assists in calling the proper index in the array of entity strings.
58 59 60 |
# File 'lib/wit_ruby/rest/entity.rb', line 58 def [](num) @entities[num] end |
#each ⇒ String
Assists in going through each entity string in the instance variable.
65 66 67 68 69 |
# File 'lib/wit_ruby/rest/entity.rb', line 65 def each @entities.each do |entity| lambda{entity} end end |