Class: PhraseApp::TranslationParams
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- PhraseApp::TranslationParams
- Defined in:
- lib/phraseapp-ruby.rb
Instance Method Summary collapse
-
#content=(val) ⇒ Object
:content, :excluded, :key_id, :locale_id, :plural_suffix, :unverified,.
- #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
:content, :excluded, :key_id, :locale_id, :plural_suffix, :unverified,
655 656 657 |
# File 'lib/phraseapp-ruby.rb', line 655 def content=(val) self.content = val end |
#excluded=(val) ⇒ Object
659 660 661 662 663 664 665 666 667 |
# File 'lib/phraseapp-ruby.rb', line 659 def excluded=(val) if val == "true" self.excluded = true elsif val == "false" #ignore self.excluded = b else PhraseApp::ParamsValidationError.new("invalid value #{val}") end end |
#key_id=(val) ⇒ Object
669 670 671 |
# File 'lib/phraseapp-ruby.rb', line 669 def key_id=(val) self.key_id = val end |
#locale_id=(val) ⇒ Object
673 674 675 |
# File 'lib/phraseapp-ruby.rb', line 673 def locale_id=(val) self.locale_id = val end |
#plural_suffix=(val) ⇒ Object
677 678 679 |
# File 'lib/phraseapp-ruby.rb', line 677 def plural_suffix=(val) self.plural_suffix = val end |
#unverified=(val) ⇒ Object
681 682 683 684 685 686 687 688 689 |
# File 'lib/phraseapp-ruby.rb', line 681 def unverified=(val) if val == "true" self.unverified = true elsif val == "false" #ignore self.unverified = b else PhraseApp::ParamsValidationError.new("invalid value #{val}") end end |
#validate ⇒ Object
691 692 693 694 695 696 697 698 699 |
# File 'lib/phraseapp-ruby.rb', line 691 def validate if self.content == nil || self.content == "" raise PhraseApp::ParamsValidationError.new("Required parameter \"content\" of \"TranslationParams\" not set") endif self.key_id == nil raise PhraseApp::ParamsValidationError.new("Required parameter \"key_id\" of \"TranslationParams\" not set") endif self.locale_id == nil raise PhraseApp::ParamsValidationError.new("Required parameter \"locale_id\" of \"TranslationParams\" not set") end end |