Class: AdvancedBilling::ProformaCustomField

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

Overview

ProformaCustomField Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(owner_id = SKIP, owner_type = SKIP, name = SKIP, value = SKIP, metadatum_id = SKIP) ⇒ ProformaCustomField

Returns a new instance of ProformaCustomField.



59
60
61
62
63
64
65
66
# File 'lib/advanced_billing/models/proforma_custom_field.rb', line 59

def initialize(owner_id = SKIP, owner_type = SKIP, name = SKIP,
               value = SKIP, metadatum_id = SKIP)
  @owner_id = owner_id unless owner_id == SKIP
  @owner_type = owner_type unless owner_type == SKIP
  @name = name unless name == SKIP
  @value = value unless value == SKIP
  @metadatum_id = metadatum_id unless metadatum_id == SKIP
end

Instance Attribute Details

#metadatum_idFloat

TODO: Write general description for this method

Returns:

  • (Float)


30
31
32
# File 'lib/advanced_billing/models/proforma_custom_field.rb', line 30

def metadatum_id
  @metadatum_id
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/advanced_billing/models/proforma_custom_field.rb', line 22

def name
  @name
end

#owner_idFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def owner_id
  @owner_id
end

#owner_typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def owner_type
  @owner_type
end

#valueString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/advanced_billing/models/proforma_custom_field.rb', line 26

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/advanced_billing/models/proforma_custom_field.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  owner_id = hash.key?('owner_id') ? hash['owner_id'] : SKIP
  owner_type = hash.key?('owner_type') ? hash['owner_type'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  value = hash.key?('value') ? hash['value'] : SKIP
  metadatum_id = hash.key?('metadatum_id') ? hash['metadatum_id'] : SKIP

  # Create object from extracted values.
  ProformaCustomField.new(owner_id,
                          owner_type,
                          name,
                          value,
                          metadatum_id)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/advanced_billing/models/proforma_custom_field.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['owner_id'] = 'owner_id'
  @_hash['owner_type'] = 'owner_type'
  @_hash['name'] = 'name'
  @_hash['value'] = 'value'
  @_hash['metadatum_id'] = 'metadatum_id'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/advanced_billing/models/proforma_custom_field.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/advanced_billing/models/proforma_custom_field.rb', line 44

def self.optionals
  %w[
    owner_id
    owner_type
    name
    value
    metadatum_id
  ]
end