Class: AdvancedBilling::DunningStepReached
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::DunningStepReached
- Defined in:
- lib/advanced_billing/models/dunning_step_reached.rb
Overview
DunningStepReached Model.
Instance Attribute Summary collapse
-
#current_step ⇒ DunningStepData
TODO: Write general description for this method.
-
#dunner ⇒ DunnerData
TODO: Write general description for this method.
-
#next_step ⇒ DunningStepData
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(dunner = nil, current_step = nil, next_step = nil) ⇒ DunningStepReached
constructor
A new instance of DunningStepReached.
Methods inherited from BaseModel
Constructor Details
#initialize(dunner = nil, current_step = nil, next_step = nil) ⇒ DunningStepReached
Returns a new instance of DunningStepReached.
43 44 45 46 47 48 49 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 43 def initialize(dunner = nil, current_step = nil, next_step = nil) @dunner = dunner @current_step = current_step @next_step = next_step end |
Instance Attribute Details
#current_step ⇒ DunningStepData
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 18 def current_step @current_step end |
#dunner ⇒ DunnerData
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 14 def dunner @dunner end |
#next_step ⇒ DunningStepData
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 22 def next_step @next_step end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. dunner = DunnerData.from_hash(hash['dunner']) if hash['dunner'] current_step = DunningStepData.from_hash(hash['current_step']) if hash['current_step'] next_step = DunningStepData.from_hash(hash['next_step']) if hash['next_step'] # Create object from extracted values. DunningStepReached.new(dunner, current_step, next_step) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['dunner'] = 'dunner' @_hash['current_step'] = 'current_step' @_hash['next_step'] = 'next_step' @_hash end |
.nullables ⇒ Object
An array for nullable fields
39 40 41 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 39 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 34 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/advanced_billing/models/dunning_step_reached.rb', line 68 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.dunner, ->(val) { DunnerData.validate(val) }) and APIHelper.valid_type?(value.current_step, ->(val) { DunningStepData.validate(val) }) and APIHelper.valid_type?(value.next_step, ->(val) { DunningStepData.validate(val) }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['dunner'], ->(val) { DunnerData.validate(val) }) and APIHelper.valid_type?(value['current_step'], ->(val) { DunningStepData.validate(val) }) and APIHelper.valid_type?(value['next_step'], ->(val) { DunningStepData.validate(val) }) ) end |