Class: FdxV660Api::Iso93622022BusinessIdentifierCodeEntity

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb

Overview

ISO 9362:2022 Business Identifier Code for Financial Institutions (see whitepaper), supersedes ISO 9362:2014

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(business_id_code2022: SKIP, additional_properties: nil) ⇒ Iso93622022BusinessIdentifierCodeEntity

Returns a new instance of Iso93622022BusinessIdentifierCodeEntity.



38
39
40
41
42
43
44
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 38

def initialize(business_id_code2022: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @business_id_code2022 = business_id_code2022 unless business_id_code2022 == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#business_id_code2022String

ISO 9362:2022 business identifier code of the financial institution

Returns:

  • (String)


17
18
19
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 17

def business_id_code2022
  @business_id_code2022
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 47

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  business_id_code2022 =
    hash.key?('businessIdCode2022') ? hash['businessIdCode2022'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  Iso93622022BusinessIdentifierCodeEntity.new(business_id_code2022: business_id_code2022,
                                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



20
21
22
23
24
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 20

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['business_id_code2022'] = 'businessIdCode2022'
  @_hash
end

.nullablesObject

An array for nullable fields



34
35
36
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 34

def self.nullables
  []
end

.optionalsObject

An array for optional fields



27
28
29
30
31
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 27

def self.optionals
  %w[
    business_id_code2022
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



68
69
70
71
72
73
74
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 68

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



84
85
86
87
88
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 84

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} business_id_code2022: #{@business_id_code2022.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



77
78
79
80
81
# File 'lib/fdx_v660_api/models/iso93622022_business_identifier_code_entity.rb', line 77

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} business_id_code2022: #{@business_id_code2022}, additional_properties:"\
  " #{@additional_properties}>"
end