Class: ThePlaidApi::SignalScheduleRecommendation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::SignalScheduleRecommendation
- Defined in:
- lib/the_plaid_api/models/signal_schedule_recommendation.rb
Overview
Conveys information on if a retry is recommended on a given date
Instance Attribute Summary collapse
-
#date ⇒ Date
The specific date for submitting the debit entry, formatted in ISO 8601 (e.g., “2025-01-17”).
-
#rank ⇒ Integer
The rank of the recommendation based on the likelihood of debit success, with 1 representing the most optimal date.
-
#recommendation ⇒ RecommendationString
The recommendation result for that date.
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(date: SKIP, recommendation: SKIP, rank: SKIP, additional_properties: nil) ⇒ SignalScheduleRecommendation
constructor
A new instance of SignalScheduleRecommendation.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(date: SKIP, recommendation: SKIP, rank: SKIP, additional_properties: nil) ⇒ SignalScheduleRecommendation
Returns a new instance of SignalScheduleRecommendation.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 52 def initialize(date: SKIP, recommendation: SKIP, rank: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @date = date unless date == SKIP @recommendation = recommendation unless recommendation == SKIP @rank = rank unless rank == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#date ⇒ Date
The specific date for submitting the debit entry, formatted in ISO 8601 (e.g., “2025-01-17”).
15 16 17 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 15 def date @date end |
#rank ⇒ Integer
The rank of the recommendation based on the likelihood of debit success, with 1 representing the most optimal date. Dates with ‘NOT_RECOMMENDED` or `UNKNOWN` will have rank `null`.
25 26 27 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 25 def rank @rank end |
#recommendation ⇒ RecommendationString
The recommendation result for that date.
19 20 21 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 19 def recommendation @recommendation end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. date = hash.key?('date') ? hash['date'] : SKIP recommendation = hash.key?('recommendation') ? hash['recommendation'] : SKIP rank = hash.key?('rank') ? hash['rank'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. SignalScheduleRecommendation.new(date: date, recommendation: recommendation, rank: rank, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['date'] = 'date' @_hash['recommendation'] = 'recommendation' @_hash['rank'] = 'rank' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 49 50 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 46 def self.nullables %w[ rank ] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 40 41 42 43 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 37 def self.optionals %w[ date recommendation rank ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
95 96 97 98 99 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 95 def inspect class_name = self.class.name.split('::').last "<#{class_name} date: #{@date.inspect}, recommendation: #{@recommendation.inspect}, rank:"\ " #{@rank.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
88 89 90 91 92 |
# File 'lib/the_plaid_api/models/signal_schedule_recommendation.rb', line 88 def to_s class_name = self.class.name.split('::').last "<#{class_name} date: #{@date}, recommendation: #{@recommendation}, rank: #{@rank},"\ " additional_properties: #{@additional_properties}>" end |