tpaga 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,75 +0,0 @@
1
- require 'date'
2
-
3
- module Tpaga
4
- class CreditCardCreate
5
- attr_accessor :billingAddress, :cardHolderName, :cardVerificationCode, :expirationMonth, :expirationYear, :primaryAccountNumber
6
-
7
- # :internal => :external
8
- def self.attribute_map
9
- {
10
- :billingAddress => :'billingAddress',
11
- :cardHolderName => :'cardHolderName',
12
- :cardVerificationCode => :'cardVerificationCode',
13
- :expirationMonth => :'expirationMonth',
14
- :expirationYear => :'expirationYear',
15
- :primaryAccountNumber => :'primaryAccountNumber'
16
-
17
- }
18
- end
19
-
20
- def initialize(attributes = {})
21
- return if attributes.empty?
22
-
23
- # convert hash key from symbol to string
24
- # and convert object to hash
25
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_s] = Swagger.to_body(v); memo}
26
-
27
- # Morph attribute keys into undescored rubyish style
28
- if self.class.attribute_map[:"billingAddress"]
29
- @billingAddress = BillingAddress.new(attributes["billingAddress"]) if (attributes["billingAddress"].kind_of? Hash)
30
- end
31
- if self.class.attribute_map[:"cardHolderName"]
32
- @cardHolderName = attributes["cardHolderName"]
33
- end
34
- if self.class.attribute_map[:"cardVerificationCode"]
35
- @cardVerificationCode = attributes["cardVerificationCode"]
36
- end
37
- if self.class.attribute_map[:"expirationMonth"]
38
- @expirationMonth = attributes["expirationMonth"]
39
- end
40
- if self.class.attribute_map[:"expirationYear"]
41
- @expirationYear = attributes["expirationYear"]
42
- end
43
- if self.class.attribute_map[:"primaryAccountNumber"]
44
- @primaryAccountNumber = attributes["primaryAccountNumber"]
45
- end
46
-
47
-
48
- end
49
-
50
- def to_body
51
- body = {}
52
- self.class.attribute_map.each_pair do |key, value|
53
- next if self.send(key).nil?
54
-
55
- if self.send(key).respond_to? :to_body
56
- body[value] = self.send(key).to_body
57
- elsif self.send(key).kind_of?(Array)
58
- body[value] = []
59
- self.send(key).each do |arr|
60
- if arr.respond_to? :to_body
61
- body[value] << arr.to_body
62
- else
63
- body[value] << arr
64
- end
65
- end
66
- else
67
- body[value] = self.send(key)
68
- end
69
-
70
- end
71
- body
72
- end
73
- end
74
- end
75
-