Method: OCI::LoadBalancer::Models::UpdateBackendDetails#initialize

Defined in:
lib/oci/load_balancer/models/update_backend_details.rb

#initialize(attributes = {}) ⇒ UpdateBackendDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :weight (Integer)

    The value to assign to the #weight property

  • :backup (BOOLEAN)

    The value to assign to the #backup property

  • :drain (BOOLEAN)

    The value to assign to the #drain property

  • :offline (BOOLEAN)

    The value to assign to the #offline property



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/load_balancer/models/update_backend_details.rb', line 81

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.weight = attributes[:'weight'] if attributes[:'weight']

  self.backup = attributes[:'backup'] unless attributes[:'backup'].nil?
  self.backup = false if backup.nil? && !attributes.key?(:'backup') # rubocop:disable Style/StringLiterals

  self.drain = attributes[:'drain'] unless attributes[:'drain'].nil?
  self.drain = false if drain.nil? && !attributes.key?(:'drain') # rubocop:disable Style/StringLiterals

  self.offline = attributes[:'offline'] unless attributes[:'offline'].nil?
  self.offline = false if offline.nil? && !attributes.key?(:'offline') # rubocop:disable Style/StringLiterals
end