Class: PhraseApp::RequestParams::TranslationParams

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

Overview

TranslationParams

Parameters:

content

Translation content

excluded

Indicates whether translation is excluded.

key_id

Key

locale_id

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

plural_suffix

Plural suffix. Can be one of: zero, one, two, few, many, other.

unverified

Indicates whether translation is unverified.

Instance Method Summary collapse

Instance Method Details

#content=(val) ⇒ Object



840
841
842
# File 'lib/phraseapp-ruby.rb', line 840

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

#excluded=(val) ⇒ Object



844
845
846
847
848
849
850
851
852
# File 'lib/phraseapp-ruby.rb', line 844

def excluded=(val)
  if val == "true"
    self.excluded = true
  elsif val == "false" #ignore
    self.excluded = b
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#key_id=(val) ⇒ Object



854
855
856
# File 'lib/phraseapp-ruby.rb', line 854

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

#locale_id=(val) ⇒ Object



858
859
860
# File 'lib/phraseapp-ruby.rb', line 858

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

#plural_suffix=(val) ⇒ Object



862
863
864
# File 'lib/phraseapp-ruby.rb', line 862

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

#unverified=(val) ⇒ Object



866
867
868
869
870
871
872
873
874
# File 'lib/phraseapp-ruby.rb', line 866

def unverified=(val)
  if val == "true"
    self.unverified = true
  elsif val == "false" #ignore
    self.unverified = b
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#validateObject



876
877
878
879
880
881
882
883
884
# File 'lib/phraseapp-ruby.rb', line 876

def validate
  if self.content == nil || self.content == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"content\" of \"TranslationParams\" not set")
  endif self.key_id == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"key_id\" of \"TranslationParams\" not set")
  endif self.locale_id == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"locale_id\" of \"TranslationParams\" not set")
  end
end