Class: Lara::Models::DetectResult

Inherits:
Base
  • Object
show all
Defined in:
lib/lara/models/text.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

parse_time

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_typeObject (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

#languageObject (readonly)

Returns the value of attribute language.



130
131
132
# File 'lib/lara/models/text.rb', line 130

def language
  @language
end

#predictionsObject (readonly)

Returns the value of attribute predictions.



130
131
132
# File 'lib/lara/models/text.rb', line 130

def predictions
  @predictions
end