Class: WitBot::WitModel::Entity
- Defined in:
- lib/wit_bot/models/wit/entity.rb
Constant Summary collapse
- @@entities =
{}
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id, doc = false, values = nil, request: false) ⇒ Entity
constructor
A new instance of Entity.
- #model(role, data) ⇒ Object
Methods inherited from Base
all, #create, #delete, #from_response_data, get, #get, #on_delete, #to_h
Constructor Details
#initialize(id, doc = false, values = nil, request: false) ⇒ Entity
Returns a new instance of Entity.
12 13 14 15 16 17 18 19 |
# File 'lib/wit_bot/models/wit/entity.rb', line 12 def initialize(id, doc=false, values=nil, request: false) super @doc = doc @values = values @uuid = nil @@entities[name] = self end |
Class Method Details
Instance Method Details
#==(other) ⇒ Object
29 30 31 |
# File 'lib/wit_bot/models/wit/entity.rb', line 29 def ==(other) self.name == other.name end |
#model(role, data) ⇒ Object
21 22 23 |
# File 'lib/wit_bot/models/wit/entity.rb', line 21 def model(role, data) EntityModel.new self, role, data end |