Class: Toptranslation::Resource::Translation
- Inherits:
-
Object
- Object
- Toptranslation::Resource::Translation
- Defined in:
- lib/toptranslation/resource/translation.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#external_checksum ⇒ Object
readonly
Returns the value of attribute external_checksum.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#filesize ⇒ Object
readonly
Returns the value of attribute filesize.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#progress ⇒ Object
readonly
Returns the value of attribute progress.
-
#segments_sha1 ⇒ Object
readonly
Returns the value of attribute segments_sha1.
-
#sha1 ⇒ Object
readonly
Returns the value of attribute sha1.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(connection, options = {}) ⇒ Translation
constructor
A new instance of Translation.
- #reference_documents ⇒ Object
Constructor Details
#initialize(connection, options = {}) ⇒ Translation
Returns a new instance of Translation.
6 7 8 9 10 |
# File 'lib/toptranslation/resource/translation.rb', line 6 def initialize(connection, = {}) @connection = connection @options = update_from_response() end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def created_at @created_at end |
#external_checksum ⇒ Object (readonly)
Returns the value of attribute external_checksum.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def external_checksum @external_checksum end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def filename @filename end |
#filesize ⇒ Object (readonly)
Returns the value of attribute filesize.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def filesize @filesize end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def identifier @identifier end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def locale @locale end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def mime_type @mime_type end |
#progress ⇒ Object (readonly)
Returns the value of attribute progress.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def progress @progress end |
#segments_sha1 ⇒ Object (readonly)
Returns the value of attribute segments_sha1.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def segments_sha1 @segments_sha1 end |
#sha1 ⇒ Object (readonly)
Returns the value of attribute sha1.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def sha1 @sha1 end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/toptranslation/resource/translation.rb', line 3 def updated_at @updated_at end |
Instance Method Details
#download ⇒ Object
18 19 20 |
# File 'lib/toptranslation/resource/translation.rb', line 18 def download @connection.download(download_url, @filename) end |
#reference_documents ⇒ Object
12 13 14 15 16 |
# File 'lib/toptranslation/resource/translation.rb', line 12 def reference_documents @reference_documents ||= @options['reference_documents'].inject([]) do |accu, reference_document| accu << ReferenceDocument.new(@connection, reference_document) end end |