Class: AdvancedBilling::DunningStepData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::DunningStepData
- Defined in:
- lib/advanced_billing/models/dunning_step_data.rb
Overview
DunningStepData Model.
Instance Attribute Summary collapse
-
#action ⇒ String
TODO: Write general description for this method.
-
#day_threshold ⇒ Integer
TODO: Write general description for this method.
-
#email_body ⇒ String
TODO: Write general description for this method.
-
#email_subject ⇒ String
TODO: Write general description for this method.
-
#send_bcc_email ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#send_email ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#send_sms ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#sms_body ⇒ 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(day_threshold = nil, action = nil, send_email = nil, send_bcc_email = nil, send_sms = nil, email_body = SKIP, email_subject = SKIP, sms_body = SKIP) ⇒ DunningStepData
constructor
A new instance of DunningStepData.
Methods inherited from BaseModel
Constructor Details
#initialize(day_threshold = nil, action = nil, send_email = nil, send_bcc_email = nil, send_sms = nil, email_body = SKIP, email_subject = SKIP, sms_body = SKIP) ⇒ DunningStepData
Returns a new instance of DunningStepData.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 76 def initialize(day_threshold = nil, action = nil, send_email = nil, send_bcc_email = nil, send_sms = nil, email_body = SKIP, email_subject = SKIP, sms_body = SKIP) @day_threshold = day_threshold @action = action @email_body = email_body unless email_body == SKIP @email_subject = email_subject unless email_subject == SKIP @send_email = send_email @send_bcc_email = send_bcc_email @send_sms = send_sms @sms_body = sms_body unless sms_body == SKIP end |
Instance Attribute Details
#action ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 18 def action @action end |
#day_threshold ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 14 def day_threshold @day_threshold end |
#email_body ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 22 def email_body @email_body end |
#email_subject ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 26 def email_subject @email_subject end |
#send_bcc_email ⇒ TrueClass | FalseClass
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 34 def send_bcc_email @send_bcc_email end |
#send_email ⇒ TrueClass | FalseClass
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 30 def send_email @send_email end |
#send_sms ⇒ TrueClass | FalseClass
TODO: Write general description for this method
38 39 40 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 38 def send_sms @send_sms end |
#sms_body ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 42 def sms_body @sms_body end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 95 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. day_threshold = hash.key?('day_threshold') ? hash['day_threshold'] : nil action = hash.key?('action') ? hash['action'] : nil send_email = hash.key?('send_email') ? hash['send_email'] : nil send_bcc_email = hash.key?('send_bcc_email') ? hash['send_bcc_email'] : nil send_sms = hash.key?('send_sms') ? hash['send_sms'] : nil email_body = hash.key?('email_body') ? hash['email_body'] : SKIP email_subject = hash.key?('email_subject') ? hash['email_subject'] : SKIP sms_body = hash.key?('sms_body') ? hash['sms_body'] : SKIP # Create object from extracted values. DunningStepData.new(day_threshold, action, send_email, send_bcc_email, send_sms, email_body, email_subject, sms_body) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['day_threshold'] = 'day_threshold' @_hash['action'] = 'action' @_hash['email_body'] = 'email_body' @_hash['email_subject'] = 'email_subject' @_hash['send_email'] = 'send_email' @_hash['send_bcc_email'] = 'send_bcc_email' @_hash['send_sms'] = 'send_sms' @_hash['sms_body'] = 'sms_body' @_hash end |
.nullables ⇒ Object
An array for nullable fields
68 69 70 71 72 73 74 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 68 def self.nullables %w[ email_body email_subject sms_body ] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 |
# File 'lib/advanced_billing/models/dunning_step_data.rb', line 59 def self.optionals %w[ email_body email_subject sms_body ] end |