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
- #to_h ⇒ Object
- #unverified=(val) ⇒ Object
- #validate ⇒ Object
Instance Method Details
#content=(val) ⇒ Object
893 894 895 |
# File 'lib/phraseapp-ruby.rb', line 893 def content=(val) self.content = val end |
#excluded=(val) ⇒ Object
897 898 899 900 901 902 903 904 905 |
# File 'lib/phraseapp-ruby.rb', line 897 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
907 908 909 |
# File 'lib/phraseapp-ruby.rb', line 907 def key_id=(val) self.key_id = val end |
#locale_id=(val) ⇒ Object
911 912 913 |
# File 'lib/phraseapp-ruby.rb', line 911 def locale_id=(val) self.locale_id = val end |
#plural_suffix=(val) ⇒ Object
915 916 917 |
# File 'lib/phraseapp-ruby.rb', line 915 def plural_suffix=(val) self.plural_suffix = val end |
#to_h ⇒ Object
939 940 941 |
# File 'lib/phraseapp-ruby.rb', line 939 def to_h @table.dup end |
#unverified=(val) ⇒ Object
919 920 921 922 923 924 925 926 927 |
# File 'lib/phraseapp-ruby.rb', line 919 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
929 930 931 932 933 934 935 936 937 |
# File 'lib/phraseapp-ruby.rb', line 929 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 |