Class: Lara::Models::DetectResult
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#predictions ⇒ Object
readonly
Returns the value of attribute predictions.
Instance Method Summary collapse
-
#initialize(language:, content_type:, predictions: []) ⇒ DetectResult
constructor
A new instance of DetectResult.
Methods inherited from Base
Constructor Details
#initialize(language:, content_type:, predictions: []) ⇒ DetectResult
Returns a new instance of DetectResult.
132 133 134 135 136 137 |
# File 'lib/lara/models/text.rb', line 132 def initialize(language:, content_type:, predictions: []) super() @language = language @content_type = content_type @predictions = predictions.map { |p| DetectPrediction.new(**p.transform_keys(&:to_sym)) } end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
130 131 132 |
# File 'lib/lara/models/text.rb', line 130 def content_type @content_type end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
130 131 132 |
# File 'lib/lara/models/text.rb', line 130 def language @language end |
#predictions ⇒ Object (readonly)
Returns the value of attribute predictions.
130 131 132 |
# File 'lib/lara/models/text.rb', line 130 def predictions @predictions end |