Class: PhraseApp::RequestParams::GlossaryTermParams

Inherits:
OpenStruct
  • Object
show all
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

Instance Method Details

#case_sensitive=(val) ⇒ Object



511
512
513
514
515
516
517
518
519
# File 'lib/phraseapp-ruby.rb', line 511

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



521
522
523
# File 'lib/phraseapp-ruby.rb', line 521

def description=(val)
  super(val)
end

#term=(val) ⇒ Object



525
526
527
# File 'lib/phraseapp-ruby.rb', line 525

def term=(val)
  super(val)
end

#translatable=(val) ⇒ Object



529
530
531
532
533
534
535
536
537
# File 'lib/phraseapp-ruby.rb', line 529

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

#validateObject



539
540
541
542
543
544
# File 'lib/phraseapp-ruby.rb', line 539

def validate
  
  if term == nil || term == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"term\" of \"GlossaryTermParams\" not set")
  end
end