Class: PhraseApp::RequestParams::GlossaryTermParams
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- PhraseApp::RequestParams::GlossaryTermParams
- Defined in:
- lib/phraseapp-ruby.rb
Overview
GlossaryTermParams
Parameters:
- case_sensitive
-
Indicates whether the term is case sensitive
- description
-
Description of term
- term
-
Glossary term
- translatable
-
Indicates whether the term should be used for all languages or can be translated
Instance Method Summary collapse
- #case_sensitive=(val) ⇒ Object
- #description=(val) ⇒ Object
- #term=(val) ⇒ Object
- #translatable=(val) ⇒ Object
- #validate ⇒ Object
Instance Method Details
#case_sensitive=(val) ⇒ Object
734 735 736 737 738 739 740 741 742 |
# File 'lib/phraseapp-ruby.rb', line 734 def case_sensitive=(val) if val.is_a?(TrueClass) super(true) elsif val.is_a?(FalseClass) return else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#description=(val) ⇒ Object
744 745 746 |
# File 'lib/phraseapp-ruby.rb', line 744 def description=(val) super(val) end |
#term=(val) ⇒ Object
748 749 750 |
# File 'lib/phraseapp-ruby.rb', line 748 def term=(val) super(val) end |
#translatable=(val) ⇒ Object
752 753 754 755 756 757 758 759 760 |
# File 'lib/phraseapp-ruby.rb', line 752 def translatable=(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
762 763 764 765 766 767 |
# File 'lib/phraseapp-ruby.rb', line 762 def validate if term == nil || term == "" raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"term\" of \"GlossaryTermParams\" not set") end end |