Class: PhraseApp::RequestParams::LocaleParams

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/phraseapp-ruby.rb

Overview

LocaleParams

Parameters:

code

Locale ISO code

default

Indicates whether locale is the default locale. If set to true, the previous default locale the project is no longer the default locale.

main

Indicates whether locale is a main locale.

name

Locale name

rtl

Indicates whether locale is a RTL (Right-to-Left) locale.

source_locale_id

Source locale. Can be the name or public id of the locale. Preferred is the public id.

unverify_new_translations

Indicates that new translations for this locale should be marked as unverified.

unverify_updated_translations

Indicates that updated translations for this locale should be marked as unverified.

Instance Method Summary collapse

Instance Method Details

#code=(val) ⇒ Object



562
563
564
# File 'lib/phraseapp-ruby.rb', line 562

def code=(val)
  super(val)
end

#default=(val) ⇒ Object



566
567
568
569
570
571
572
573
574
# File 'lib/phraseapp-ruby.rb', line 566

def default=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#main=(val) ⇒ Object



576
577
578
579
580
581
582
583
584
# File 'lib/phraseapp-ruby.rb', line 576

def main=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#name=(val) ⇒ Object



586
587
588
# File 'lib/phraseapp-ruby.rb', line 586

def name=(val)
  super(val)
end

#rtl=(val) ⇒ Object



590
591
592
593
594
595
596
597
598
# File 'lib/phraseapp-ruby.rb', line 590

def rtl=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#source_locale_id=(val) ⇒ Object



600
601
602
# File 'lib/phraseapp-ruby.rb', line 600

def source_locale_id=(val)
  super(val)
end

#unverify_new_translations=(val) ⇒ Object



604
605
606
607
608
609
610
611
612
# File 'lib/phraseapp-ruby.rb', line 604

def unverify_new_translations=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#unverify_updated_translations=(val) ⇒ Object



614
615
616
617
618
619
620
621
622
# File 'lib/phraseapp-ruby.rb', line 614

def unverify_updated_translations=(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



624
625
626
627
628
629
630
631
632
# File 'lib/phraseapp-ruby.rb', line 624

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