Class: AdvancedBilling::SubscriptionComponentSubscription
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::SubscriptionComponentSubscription
- Defined in:
- lib/advanced_billing/models/subscription_component_subscription.rb
Overview
An optional object, will be returned if provided ‘include=subscription` query param.
Instance Attribute Summary collapse
-
#state ⇒ String
TODO: Write general description for this method.
-
#updated_at ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(state = SKIP, updated_at = SKIP) ⇒ SubscriptionComponentSubscription
constructor
A new instance of SubscriptionComponentSubscription.
Methods inherited from BaseModel
Constructor Details
#initialize(state = SKIP, updated_at = SKIP) ⇒ SubscriptionComponentSubscription
Returns a new instance of SubscriptionComponentSubscription.
42 43 44 45 |
# File 'lib/advanced_billing/models/subscription_component_subscription.rb', line 42 def initialize(state = SKIP, updated_at = SKIP) @state = state unless state == SKIP @updated_at = updated_at unless updated_at == SKIP end |
Instance Attribute Details
#state ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/advanced_billing/models/subscription_component_subscription.rb', line 15 def state @state end |
#updated_at ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/advanced_billing/models/subscription_component_subscription.rb', line 19 def updated_at @updated_at end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/advanced_billing/models/subscription_component_subscription.rb', line 48 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. state = hash.key?('state') ? hash['state'] : SKIP updated_at = hash.key?('updated_at') ? hash['updated_at'] : SKIP # Create object from extracted values. SubscriptionComponentSubscription.new(state, updated_at) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/advanced_billing/models/subscription_component_subscription.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['state'] = 'state' @_hash['updated_at'] = 'updated_at' @_hash end |
.nullables ⇒ Object
An array for nullable fields
38 39 40 |
# File 'lib/advanced_billing/models/subscription_component_subscription.rb', line 38 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 33 34 35 |
# File 'lib/advanced_billing/models/subscription_component_subscription.rb', line 30 def self.optionals %w[ state updated_at ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
62 63 64 65 66 67 68 |
# File 'lib/advanced_billing/models/subscription_component_subscription.rb', line 62 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |