Class: AdvancedBilling::CloneComponentPricePoint

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/clone_component_price_point.rb

Overview

CloneComponentPricePoint Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

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

Constructor Details

#initialize(name:, handle: SKIP, additional_properties: {}) ⇒ CloneComponentPricePoint

Returns a new instance of CloneComponentPricePoint.



40
41
42
43
44
45
46
47
48
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 40

def initialize(name:, handle: SKIP, additional_properties: {})
  # Add additional model properties to the instance.

  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end

  @name = name
  @handle = handle unless handle == SKIP
end

Instance Attribute Details

#handleString

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 18

def handle
  @handle
end

#nameString

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 14

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 51

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  name = hash.key?('name') ? hash['name'] : nil
  handle = hash.key?('handle') ? hash['handle'] : SKIP

  # Clean out expected properties from Hash.

  additional_properties = hash.reject { |k, _| names.value?(k) }

  # Create object from extracted values.

  CloneComponentPricePoint.new(name: name,
                               handle: handle,
                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 21

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

.nullablesObject

An array for nullable fields



36
37
38
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 36

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
32
33
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 29

def self.optionals
  %w[
    handle
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



75
76
77
78
79
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 75

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

#to_sObject

Provides a human-readable string representation of the object.



68
69
70
71
72
# File 'lib/advanced_billing/models/clone_component_price_point.rb', line 68

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