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