Class: LingotekClient::Resource::TranslationTarget
- Defined in:
- lib/lingotek-client/resource/translation_target.rb
Constant Summary
Constants inherited from Base
Base::ERRORS, Base::FAIL, Base::RESULTS
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#due_date ⇒ Object
Returns the value of attribute due_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#match_sentences ⇒ Object
Returns the value of attribute match_sentences.
-
#match_words ⇒ Object
Returns the value of attribute match_words.
-
#phases ⇒ Object
Returns the value of attribute phases.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #country_code ⇒ Object
- #current_phase ⇒ Object
-
#initialize(attrs) ⇒ TranslationTarget
constructor
A new instance of TranslationTarget.
Methods inherited from Base
Constructor Details
#initialize(attrs) ⇒ TranslationTarget
Returns a new instance of TranslationTarget.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 6 def initialize(attrs) super(attrs) @id = attrs['id'] @language = attrs['language'] @due_date = attrs['due_date'] @description = attrs['description'] @match_sentences= attrs['matchSentneces'] @match_words= attrs['matchWords'] @phases = attrs['phases'] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 4 def description @description end |
#due_date ⇒ Object
Returns the value of attribute due_date.
4 5 6 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 4 def due_date @due_date end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 4 def id @id end |
#language ⇒ Object
Returns the value of attribute language.
4 5 6 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 4 def language @language end |
#match_sentences ⇒ Object
Returns the value of attribute match_sentences.
4 5 6 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 4 def match_sentences @match_sentences end |
#match_words ⇒ Object
Returns the value of attribute match_words.
4 5 6 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 4 def match_words @match_words end |
#phases ⇒ Object
Returns the value of attribute phases.
4 5 6 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 4 def phases @phases end |
Class Method Details
.find_by_document_id(id) ⇒ Object
17 18 19 20 21 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 17 def self.find_by_document_id(id) objects = JSON.parse(Lingotek::API::api.listTranslationTargets( documentId: id ) ) objects = objects['translationTargets'] objects.map { |obj| self.new obj } end |
Instance Method Details
#country_code ⇒ Object
27 28 29 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 27 def country_code @language.split('_').last.downcase end |
#current_phase ⇒ Object
23 24 25 |
# File 'lib/lingotek-client/resource/translation_target.rb', line 23 def current_phase @phase.first if @phase end |