Class: CloudRailSi::Types::SubscriptionPlan
- Inherits:
-
SandboxObject
- Object
- SandboxObject
- CloudRailSi::Types::SubscriptionPlan
- Defined in:
- lib/cloudrail_si/types/SubscriptionPlan.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#interval ⇒ Object
readonly
Returns the value of attribute interval.
-
#interval_count ⇒ Object
readonly
Returns the value of attribute interval_count.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(amount, crated, currency, description, id, interval, interval_count, name) ⇒ SubscriptionPlan
constructor
A new instance of SubscriptionPlan.
Methods inherited from SandboxObject
Constructor Details
#initialize(amount, crated, currency, description, id, interval, interval_count, name) ⇒ SubscriptionPlan
Returns a new instance of SubscriptionPlan.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 9 def initialize(amount, crated, currency, description, id, interval, interval_count, name) super() @amount = amount @created = created @currency = currency @description = description @id = id @interval = interval @interval_count = interval_count @name = name raise Errors::IllegalArgumentError.new("At least one of the parameters is undefined.") if (currency.nil? || description.nil? || id.nil? || interval.nil? || name.nil?) raise Errors::IllegalArgumentError.new("Amount can not be less than 0.") if (amount < 0) raise Errors::IllegalArgumentError.new("Passed currency is not a valid three-letter currency code.") if (currency.length != 3) raise Errors::IllegalArgumentError.new("Unknown interval. Allowed values are: 'day', 'week', 'month' or 'year'.") if (["day", "week", "month", "year"].index(interval) < 0) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
7 8 9 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 7 def amount @amount end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
7 8 9 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 7 def created @created end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 7 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 7 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 7 def id @id end |
#interval ⇒ Object (readonly)
Returns the value of attribute interval.
7 8 9 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 7 def interval @interval end |
#interval_count ⇒ Object (readonly)
Returns the value of attribute interval_count.
7 8 9 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 7 def interval_count @interval_count end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/cloudrail_si/types/SubscriptionPlan.rb', line 7 def name @name end |