Class: Asdawqw::FeeTaxMandatorySetting

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/asdawqw/models/fee_tax_mandatory_setting.rb

Overview

FeeTaxMandatorySetting Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(product_id = nil, is_fee_mandatory = nil, is_tax_mandatory = nil) ⇒ FeeTaxMandatorySetting

Returns a new instance of FeeTaxMandatorySetting.



30
31
32
33
34
35
36
# File 'lib/asdawqw/models/fee_tax_mandatory_setting.rb', line 30

def initialize(product_id = nil,
               is_fee_mandatory = nil,
               is_tax_mandatory = nil)
  @product_id = product_id
  @is_fee_mandatory = is_fee_mandatory
  @is_tax_mandatory = is_tax_mandatory
end

Instance Attribute Details

#is_fee_mandatoryBoolean

Fee is mandatory

Returns:

  • (Boolean)


15
16
17
# File 'lib/asdawqw/models/fee_tax_mandatory_setting.rb', line 15

def is_fee_mandatory
  @is_fee_mandatory
end

#is_tax_mandatoryBoolean

Tax is mandatory

Returns:

  • (Boolean)


19
20
21
# File 'lib/asdawqw/models/fee_tax_mandatory_setting.rb', line 19

def is_tax_mandatory
  @is_tax_mandatory
end

#product_idInteger

Product id

Returns:

  • (Integer)


11
12
13
# File 'lib/asdawqw/models/fee_tax_mandatory_setting.rb', line 11

def product_id
  @product_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/asdawqw/models/fee_tax_mandatory_setting.rb', line 39

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  product_id = hash['productId']
  is_fee_mandatory = hash['isFeeMandatory']
  is_tax_mandatory = hash['isTaxMandatory']

  # Create object from extracted values.
  FeeTaxMandatorySetting.new(product_id,
                             is_fee_mandatory,
                             is_tax_mandatory)
end

.namesObject

A mapping from model property names to API property names.



22
23
24
25
26
27
28
# File 'lib/asdawqw/models/fee_tax_mandatory_setting.rb', line 22

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['product_id'] = 'productId'
  @_hash['is_fee_mandatory'] = 'isFeeMandatory'
  @_hash['is_tax_mandatory'] = 'isTaxMandatory'
  @_hash
end