Class: Apollo::Bot::Classification
- Inherits:
-
Object
- Object
- Apollo::Bot::Classification
- Defined in:
- lib/apollo/bot/classification.rb
Defined Under Namespace
Classes: Class
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#classifier_id ⇒ Object
readonly
Returns the value of attribute classifier_id.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#top_class ⇒ Object
readonly
Returns the value of attribute top_class.
Instance Method Summary collapse
- #classifier ⇒ Object
-
#initialize(attrs = {}) ⇒ Classification
constructor
A new instance of Classification.
Constructor Details
#initialize(attrs = {}) ⇒ Classification
Returns a new instance of Classification.
16 17 18 19 20 21 |
# File 'lib/apollo/bot/classification.rb', line 16 def initialize(attrs = {}) @classifier_id = attrs["classifier_id"] @text = attrs["text"] @top_class = attrs["top_class"] @classes = attrs["classes"].map { |attrs| Apollo::Bot::Classification::Class.new(attrs) } end |
Instance Attribute Details
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
14 15 16 |
# File 'lib/apollo/bot/classification.rb', line 14 def classes @classes end |
#classifier_id ⇒ Object (readonly)
Returns the value of attribute classifier_id.
14 15 16 |
# File 'lib/apollo/bot/classification.rb', line 14 def classifier_id @classifier_id end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
14 15 16 |
# File 'lib/apollo/bot/classification.rb', line 14 def text @text end |
#top_class ⇒ Object (readonly)
Returns the value of attribute top_class.
14 15 16 |
# File 'lib/apollo/bot/classification.rb', line 14 def top_class @top_class end |
Instance Method Details
#classifier ⇒ Object
23 24 25 |
# File 'lib/apollo/bot/classification.rb', line 23 def classifier @classifier ||= Apollo::Bot::Classifier.find(classifier_id) end |