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.
79 80 81 82 83 84 85 |
# File 'lib/lara/models/images.rb', line 79 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.
21 22 23 |
# File 'lib/lara/models/images.rb', line 21 def adapted_to @adapted_to end |
#glossaries ⇒ Object (readonly)
Returns the value of attribute glossaries.
21 22 23 |
# File 'lib/lara/models/images.rb', line 21 def glossaries @glossaries end |
#paragraphs ⇒ Object (readonly)
Returns the value of attribute paragraphs.
21 22 23 |
# File 'lib/lara/models/images.rb', line 21 def paragraphs @paragraphs end |
#source_language ⇒ Object (readonly)
Returns the value of attribute source_language.
21 22 23 |
# File 'lib/lara/models/images.rb', line 21 def source_language @source_language end |
Class Method Details
.from_hash(hash) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/lara/models/images.rb', line 23 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 |