Class: PhraseApp::RequestParams::ProjectParams
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- PhraseApp::RequestParams::ProjectParams
- Defined in:
- lib/phraseapp-ruby.rb
Overview
ProjectParams
Parameters:
- main_format
-
Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see <a href=“guides/formats/”>Format Guide</a> or our <a href=“api.phraseapp.com/api/v2/formats”>Formats API Endpoint</a>.
- name
-
Name of the project
- shares_translation_memory
-
Indicates whether the project should share the account’s translation memory
Instance Method Summary collapse
- #main_format=(val) ⇒ Object
- #name=(val) ⇒ Object
- #shares_translation_memory=(val) ⇒ Object
- #to_h ⇒ Object
- #validate ⇒ Object
Instance Method Details
#main_format=(val) ⇒ Object
725 726 727 |
# File 'lib/phraseapp-ruby.rb', line 725 def main_format=(val) self.main_format = val end |
#name=(val) ⇒ Object
729 730 731 |
# File 'lib/phraseapp-ruby.rb', line 729 def name=(val) self.name = val end |
#shares_translation_memory=(val) ⇒ Object
733 734 735 736 737 738 739 740 741 |
# File 'lib/phraseapp-ruby.rb', line 733 def shares_translation_memory=(val) if val.is_a?(TrueClass) self.shares_translation_memory = true elsif val.is_a?(FalseClass) #ignore self.shares_translation_memory = b else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#to_h ⇒ Object
749 750 751 |
# File 'lib/phraseapp-ruby.rb', line 749 def to_h @table.dup end |
#validate ⇒ Object
743 744 745 746 747 |
# File 'lib/phraseapp-ruby.rb', line 743 def validate if self.name == nil || self.name == "" raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"name\" of \"ProjectParams\" not set") end end |