Class: Lara::Models::ImageTextResult
- Defined in:
- lib/lara/models/images.rb
Instance Attribute Summary collapse
-
#adapted_to ⇒ Object
readonly
Returns the value of attribute adapted_to.
-
#glossaries ⇒ Object
readonly
Returns the value of attribute glossaries.
-
#paragraphs ⇒ Object
readonly
Returns the value of attribute paragraphs.
-
#source_language ⇒ Object
readonly
Returns the value of attribute source_language.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source_language:, paragraphs:, adapted_to: nil, glossaries: nil) ⇒ ImageTextResult
constructor
A new instance of ImageTextResult.
Methods inherited from Base
Constructor Details
#initialize(source_language:, paragraphs:, adapted_to: nil, glossaries: nil) ⇒ ImageTextResult
Returns a new instance of ImageTextResult.
92 93 94 95 96 97 98 |
# File 'lib/lara/models/images.rb', line 92 def initialize(source_language:, paragraphs:, adapted_to: nil, glossaries: nil) super() @source_language = source_language @adapted_to = adapted_to @glossaries = glossaries @paragraphs = paragraphs end |
Instance Attribute Details
#adapted_to ⇒ Object (readonly)
Returns the value of attribute adapted_to.
34 35 36 |
# File 'lib/lara/models/images.rb', line 34 def adapted_to @adapted_to end |
#glossaries ⇒ Object (readonly)
Returns the value of attribute glossaries.
34 35 36 |
# File 'lib/lara/models/images.rb', line 34 def glossaries @glossaries end |
#paragraphs ⇒ Object (readonly)
Returns the value of attribute paragraphs.
34 35 36 |
# File 'lib/lara/models/images.rb', line 34 def paragraphs @paragraphs end |
#source_language ⇒ Object (readonly)
Returns the value of attribute source_language.
34 35 36 |
# File 'lib/lara/models/images.rb', line 34 def source_language @source_language end |
Class Method Details
.from_hash(hash) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/lara/models/images.rb', line 36 def self.from_hash(hash) return nil unless hash.is_a?(Hash) paragraphs = (hash["paragraphs"] || []).map { |p| build_paragraph(p) } new( source_language: hash["sourceLanguage"], adapted_to: hash["adaptedTo"], glossaries: hash["glossaries"], paragraphs: paragraphs ) end |