Class: AdvancedBilling::SubscriptionNote
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::SubscriptionNote
- Defined in:
- lib/advanced_billing/models/subscription_note.rb
Overview
SubscriptionNote Model.
Instance Attribute Summary collapse
-
#body ⇒ String
TODO: Write general description for this method.
-
#created_at ⇒ String
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#sticky ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#subscription_id ⇒ Integer
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.
Instance Method Summary collapse
-
#initialize(id = SKIP, body = SKIP, subscription_id = SKIP, created_at = SKIP, updated_at = SKIP, sticky = SKIP) ⇒ SubscriptionNote
constructor
A new instance of SubscriptionNote.
Methods inherited from BaseModel
Constructor Details
#initialize(id = SKIP, body = SKIP, subscription_id = SKIP, created_at = SKIP, updated_at = SKIP, sticky = SKIP) ⇒ SubscriptionNote
Returns a new instance of SubscriptionNote.
65 66 67 68 69 70 71 72 73 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 65 def initialize(id = SKIP, body = SKIP, subscription_id = SKIP, created_at = SKIP, updated_at = SKIP, sticky = SKIP) @id = id unless id == SKIP @body = body unless body == SKIP @subscription_id = subscription_id unless subscription_id == SKIP @created_at = created_at unless created_at == SKIP @updated_at = updated_at unless updated_at == SKIP @sticky = sticky unless sticky == SKIP end |
Instance Attribute Details
#body ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 18 def body @body end |
#created_at ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 26 def created_at @created_at end |
#id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 14 def id @id end |
#sticky ⇒ TrueClass | FalseClass
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 34 def sticky @sticky end |
#subscription_id ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 22 def subscription_id @subscription_id end |
#updated_at ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 30 def updated_at @updated_at end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP body = hash.key?('body') ? hash['body'] : SKIP subscription_id = hash.key?('subscription_id') ? hash['subscription_id'] : SKIP created_at = hash.key?('created_at') ? hash['created_at'] : SKIP updated_at = hash.key?('updated_at') ? hash['updated_at'] : SKIP sticky = hash.key?('sticky') ? hash['sticky'] : SKIP # Create object from extracted values. SubscriptionNote.new(id, body, subscription_id, created_at, updated_at, sticky) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['body'] = 'body' @_hash['subscription_id'] = 'subscription_id' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['sticky'] = 'sticky' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/advanced_billing/models/subscription_note.rb', line 49 def self.optionals %w[ id body subscription_id created_at updated_at sticky ] end |