Class: CloudRailSi::Types::CreditCard
- Inherits:
-
SandboxObject
- Object
- SandboxObject
- CloudRailSi::Types::CreditCard
- Includes:
- Comparable
- Defined in:
- lib/cloudrail_si/types/CreditCard.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#cvc ⇒ Object
Returns the value of attribute cvc.
-
#expire_month ⇒ Object
Returns the value of attribute expire_month.
-
#expire_year ⇒ Object
Returns the value of attribute expire_year.
-
#firstName ⇒ Object
Returns the value of attribute firstName.
-
#lastName ⇒ Object
Returns the value of attribute lastName.
-
#number ⇒ Object
Returns the value of attribute number.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #<=>(obj) ⇒ Object
-
#initialize(cvc, expire_month, expire_year, number, type, first_name, last_name, address) ⇒ CreditCard
constructor
A new instance of CreditCard.
Methods inherited from SandboxObject
Constructor Details
#initialize(cvc, expire_month, expire_year, number, type, first_name, last_name, address) ⇒ CreditCard
Returns a new instance of CreditCard.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 15 def initialize(cvc, expire_month, expire_year, number, type, first_name, last_name, address) super() @cvc = cvc @expire_month = expire_month @expire_year = expire_year @number = number @type = type @firstName = first_name @lastName = last_name @address = address end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
13 14 15 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 13 def address @address end |
#cvc ⇒ Object
Returns the value of attribute cvc.
13 14 15 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 13 def cvc @cvc end |
#expire_month ⇒ Object
Returns the value of attribute expire_month.
13 14 15 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 13 def expire_month @expire_month end |
#expire_year ⇒ Object
Returns the value of attribute expire_year.
13 14 15 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 13 def expire_year @expire_year end |
#firstName ⇒ Object
Returns the value of attribute firstName.
13 14 15 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 13 def firstName @firstName end |
#lastName ⇒ Object
Returns the value of attribute lastName.
13 14 15 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 13 def lastName @lastName end |
#number ⇒ Object
Returns the value of attribute number.
13 14 15 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 13 def number @number end |
#type ⇒ Object
Returns the value of attribute type.
13 14 15 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 13 def type @type end |
Instance Method Details
#<=>(obj) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/cloudrail_si/types/CreditCard.rb', line 50 def <=> (obj) raise Errors::InternalError.new('CreditCards must only be compared with other non-nil CreditCards') if (obj.nil? || !(obj.instance_of?(CreditCard))) another = obj compare = CloudRailSi::ServiceCode::Helper.compare(@firstName, another.firstName) return compare if (compare) compare = CloudRailSi::ServiceCode::Helper.compare(@lastName, another.lastName) return compare if (compare) compare = CloudRailSi::ServiceCode::Helper.compare(@number.substring[12..-1], another.number[12..-1]) return compare if (compare) compare = CloudRailSi::ServiceCode::Helper.compare(@expire_month, another.expire_month) return compare if (compare) compare = CloudRailSi::ServiceCode::Helper.compare(@expire_year, another.expire_year) return compare if (compare) return CloudRailSi::ServiceCode::Helper.compare(@type, another.type) end |