Class: XeroRuby::PayrollNz::TaxCode

Inherits:
Object
  • Object
show all
Defined in:
lib/xero-ruby/models/payroll_nz/tax_code.rb

Constant Summary collapse

ND =
"ND".freeze
M =
"M".freeze
ME =
"ME".freeze
MSL =
"MSL".freeze
MESL =
"MESL".freeze
SB =
"SB".freeze
S =
"S".freeze
SH =
"SH".freeze
ST =
"ST".freeze
SBSL =
"SBSL".freeze
SSL =
"SSL".freeze
SHSL =
"SHSL".freeze
STSL =
"STSL".freeze
WT =
"WT".freeze
CAE =
"CAE".freeze
EDW =
"EDW".freeze
NSW =
"NSW".freeze
STC =
"STC".freeze
STCSL =
"STCSL".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value


40
41
42
# File 'lib/xero-ruby/models/payroll_nz/tax_code.rb', line 40

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value


47
48
49
50
51
# File 'lib/xero-ruby/models/payroll_nz/tax_code.rb', line 47

def build_from_hash(value)
  constantValues = TaxCode.constants.select { |c| TaxCode::const_get(c) == value }
  raise "Invalid ENUM value #{value} for class #TaxCode" if constantValues.empty?
  value
end