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



501
502
503
# File 'lib/phraseapp-ruby.rb', line 501

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

#default=(val) ⇒ Object



505
506
507
508
509
510
511
512
513
# File 'lib/phraseapp-ruby.rb', line 505

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



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

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



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

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

#rtl=(val) ⇒ Object



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

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



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

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

#validateObject



543
544
545
546
547
548
549
# File 'lib/phraseapp-ruby.rb', line 543

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