Class: AdvancedBilling::PaymentMethodExternalType

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

Overview

PaymentMethodExternalType Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(details = SKIP, kind = SKIP, memo = SKIP, type = 'external') ⇒ PaymentMethodExternalType

Returns a new instance of PaymentMethodExternalType.



53
54
55
56
57
58
# File 'lib/advanced_billing/models/payment_method_external_type.rb', line 53

def initialize(details = SKIP, kind = SKIP, memo = SKIP, type = 'external')
  @details = details unless details == SKIP
  @kind = kind unless kind == SKIP
  @memo = memo unless memo == SKIP
  @type = type unless type == SKIP
end

Instance Attribute Details

#detailsString

TODO: Write general description for this method

Returns:

  • (String)


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

def details
  @details
end

#kindString

TODO: Write general description for this method

Returns:

  • (String)


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

def kind
  @kind
end

#memoString

TODO: Write general description for this method

Returns:

  • (String)


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

def memo
  @memo
end

#typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/advanced_billing/models/payment_method_external_type.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  details = hash.key?('details') ? hash['details'] : SKIP
  kind = hash.key?('kind') ? hash['kind'] : SKIP
  memo = hash.key?('memo') ? hash['memo'] : SKIP
  type = hash['type'] ||= 'external'

  # Create object from extracted values.
  PaymentMethodExternalType.new(details,
                                kind,
                                memo,
                                type)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/advanced_billing/models/payment_method_external_type.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['details'] = 'details'
  @_hash['kind'] = 'kind'
  @_hash['memo'] = 'memo'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/advanced_billing/models/payment_method_external_type.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/advanced_billing/models/payment_method_external_type.rb', line 39

def self.optionals
  %w[
    details
    kind
    memo
    type
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



79
80
81
82
83
84
85
# File 'lib/advanced_billing/models/payment_method_external_type.rb', line 79

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

  return false unless value.instance_of? Hash

  true
end