Class: PhraseApp::RequestParams::TranslationParams
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- PhraseApp::RequestParams::TranslationParams
- Defined in:
- lib/phraseapp-ruby.rb
Overview
TranslationParams
Parameters:
- content
-
Translation content
- excluded
-
Indicates whether translation is excluded.
- key_id
-
Key
- locale_id
-
Locale. Can be the name or public id of the locale. Preferred is the public id.
- plural_suffix
-
Plural suffix. Can be one of: zero, one, two, few, many, other.
- unverified
-
Indicates whether translation is unverified.
Instance Method Summary collapse
- #content=(val) ⇒ Object
- #excluded=(val) ⇒ Object
- #key_id=(val) ⇒ Object
- #locale_id=(val) ⇒ Object
- #plural_suffix=(val) ⇒ Object
- #unverified=(val) ⇒ Object
- #validate ⇒ Object
Instance Method Details
#content=(val) ⇒ Object
846 847 848 |
# File 'lib/phraseapp-ruby.rb', line 846 def content=(val) self.content = val end |
#excluded=(val) ⇒ Object
850 851 852 853 854 855 856 857 858 |
# File 'lib/phraseapp-ruby.rb', line 850 def excluded=(val) if val.is_a?(TrueClass) self.excluded = true elsif val.is_a?(FalseClass) #ignore self.excluded = b else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#key_id=(val) ⇒ Object
860 861 862 |
# File 'lib/phraseapp-ruby.rb', line 860 def key_id=(val) self.key_id = val end |
#locale_id=(val) ⇒ Object
864 865 866 |
# File 'lib/phraseapp-ruby.rb', line 864 def locale_id=(val) self.locale_id = val end |
#plural_suffix=(val) ⇒ Object
868 869 870 |
# File 'lib/phraseapp-ruby.rb', line 868 def plural_suffix=(val) self.plural_suffix = val end |
#unverified=(val) ⇒ Object
872 873 874 875 876 877 878 879 880 |
# File 'lib/phraseapp-ruby.rb', line 872 def unverified=(val) if val.is_a?(TrueClass) self.unverified = true elsif val.is_a?(FalseClass) #ignore self.unverified = b else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#validate ⇒ Object
882 883 884 885 886 887 888 889 890 |
# File 'lib/phraseapp-ruby.rb', line 882 def validate if self.content == nil || self.content == "" raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"content\" of \"TranslationParams\" not set") endif self.key_id == nil raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"key_id\" of \"TranslationParams\" not set") endif self.locale_id == nil raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"locale_id\" of \"TranslationParams\" not set") end end |