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.

Instance Method Summary collapse

Instance Method Details

#code=(val) ⇒ Object



509
510
511
# File 'lib/phraseapp-ruby.rb', line 509

def code=(val)
  self.code = val
end

#default=(val) ⇒ Object



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

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

#main=(val) ⇒ Object



523
524
525
526
527
528
529
530
531
# File 'lib/phraseapp-ruby.rb', line 523

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

#name=(val) ⇒ Object



533
534
535
# File 'lib/phraseapp-ruby.rb', line 533

def name=(val)
  self.name = val
end

#rtl=(val) ⇒ Object



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

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

#source_locale_id=(val) ⇒ Object



547
548
549
# File 'lib/phraseapp-ruby.rb', line 547

def source_locale_id=(val)
  self.source_locale_id = val
end

#validateObject



551
552
553
554
555
556
557
# File 'lib/phraseapp-ruby.rb', line 551

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