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
543 544 545 546 547 548 549 550 551 |
# File 'lib/phraseapp-ruby.rb', line 543 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
553 554 555 |
# File 'lib/phraseapp-ruby.rb', line 553 def description=(val) super(val) end |
#term=(val) ⇒ Object
557 558 559 |
# File 'lib/phraseapp-ruby.rb', line 557 def term=(val) super(val) end |
#translatable=(val) ⇒ Object
561 562 563 564 565 566 567 568 569 |
# File 'lib/phraseapp-ruby.rb', line 561 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
571 572 573 574 575 576 |
# File 'lib/phraseapp-ruby.rb', line 571 def validate if term == nil || term == "" raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"term\" of \"GlossaryTermParams\" not set") end end |