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
906 907 908 |
# File 'lib/phraseapp-ruby.rb', line 906 def content=(val) super(val) end |
#excluded=(val) ⇒ Object
910 911 912 913 914 915 916 917 918 |
# File 'lib/phraseapp-ruby.rb', line 910 def excluded=(val) if val.is_a?(TrueClass) super(true) elsif val.is_a?(FalseClass) return else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#key_id=(val) ⇒ Object
920 921 922 |
# File 'lib/phraseapp-ruby.rb', line 920 def key_id=(val) super(val) end |
#locale_id=(val) ⇒ Object
924 925 926 |
# File 'lib/phraseapp-ruby.rb', line 924 def locale_id=(val) super(val) end |
#plural_suffix=(val) ⇒ Object
928 929 930 |
# File 'lib/phraseapp-ruby.rb', line 928 def plural_suffix=(val) super(val) end |
#unverified=(val) ⇒ Object
932 933 934 935 936 937 938 939 940 |
# File 'lib/phraseapp-ruby.rb', line 932 def unverified=(val) if val.is_a?(TrueClass) super(true) elsif val.is_a?(FalseClass) return else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#validate ⇒ Object
942 943 944 945 946 947 948 949 950 951 952 953 |
# File 'lib/phraseapp-ruby.rb', line 942 def validate if content == nil || content == "" raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"content\" of \"TranslationParams\" not set") end if key_id == nil raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"key_id\" of \"TranslationParams\" not set") end if locale_id == nil raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"locale_id\" of \"TranslationParams\" not set") end end |