Class: GrowsurfRuby::Models::AffiliateApplication::Answer
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- GrowsurfRuby::Models::AffiliateApplication::Answer
- Defined in:
- lib/growsurf_ruby/models/affiliate_application.rb,
sig/growsurf_ruby/models/affiliate_application.rbs
Defined Under Namespace
Instance Attribute Summary collapse
-
#field_id ⇒ String
Stable key of the saved application-form field this answer belongs to.
-
#label ⇒ String
Customer-configured field label captured when the applicant submitted.
-
#type ⇒ Symbol, GrowsurfRuby::Models::AffiliateApplication::Answer::Type
Saved field type that determined how the scalar answer was validated.
-
#value ⇒ String, ...
Applicant answer represented as one validated string, number, or boolean.
Instance Method Summary collapse
-
#initialize(answers: nil, created_at: nil, decided_at: nil, email: nil, first_name: nil, id: nil, last_name: nil, participant_id: nil, reapply_allowed_at: nil, rejection_reason: nil, reviewed_at: nil, risk_level: nil, status: nil, terms_accepted_at: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see GrowsurfRuby::Models::AffiliateApplication for more details.
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(answers: nil, created_at: nil, decided_at: nil, email: nil, first_name: nil, id: nil, last_name: nil, participant_id: nil, reapply_allowed_at: nil, rejection_reason: nil, reviewed_at: nil, risk_level: nil, status: nil, terms_accepted_at: nil) ⇒ Object
Some parameter documentations has been truncated, see GrowsurfRuby::Models::AffiliateApplication for more details.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 134 class Answer < GrowsurfRuby::Internal::Type::BaseModel # @!attribute field_id # Stable key of the saved application-form field this answer belongs to. # # @return [String] required :field_id, String, api_name: :fieldId # @!attribute label # Customer-configured field label captured when the applicant submitted. # # @return [String] required :label, String # @!attribute type # Saved field type that determined how the scalar answer was validated. # # @return [Symbol, GrowsurfRuby::Models::AffiliateApplication::Answer::Type] required :type, enum: -> { GrowsurfRuby::AffiliateApplication::Answer::Type } # @!attribute value # Applicant answer represented as one validated string, number, or boolean. # # @return [String, Integer, Float, Boolean] required :value, -> { GrowsurfRuby::AffiliateApplication::Answer::Value } # @!method initialize(field_id: nil, label: nil, type: nil, value: nil) # Some parameter documentations has been truncated, see # {GrowsurfRuby::Models::AffiliateApplication::Answer} for more details. # # @param field_id [String] Stable key of the saved application-form field this answer belongs to. # # @param label [String] Customer-configured field label captured when the applicant submitted. # # @param type [Symbol, GrowsurfRuby::Models::AffiliateApplication::Answer::Type] Saved field type that determined how the scalar answer was validated. # # @param value [String, Integer, Float, Boolean] Applicant answer represented as one validated scalar. class Value extend GrowsurfRuby::Internal::Type::Converter extend GrowsurfRuby::Internal::Util::SorbetRuntimeSupport private_class_method :new def self.===(other) scalar?(other) end def self.coerce(value, state:) matches = scalar?(value) state.fetch(:exactness)[matches ? :yes : :no] += 1 state[:error] = ArgumentError.new("expected a string, number, or boolean") unless matches value end def self.to_sorbet_type T.any(String, Integer, Float, T::Boolean) end def self.scalar?(value) value.is_a?(String) || value.is_a?(Integer) || value.is_a?(Float) || value == true || value == false end private_class_method :scalar? end module Type extend GrowsurfRuby::Internal::Type::Enum TEXT = :text TEXTAREA = :textarea URL = :url COUNTRY = :country NUMBER = :number DROPDOWN = :dropdown RADIO = :radio CHECKBOX = :checkbox # @!method self.values # @return [Array<Symbol>] end end |
Instance Attribute Details
#field_id ⇒ String
Stable key of the saved application-form field this answer belongs to.
139 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 139 required :field_id, String, api_name: :fieldId |
#label ⇒ String
Customer-configured field label captured when the applicant submitted.
145 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 145 required :label, String |
#type ⇒ Symbol, GrowsurfRuby::Models::AffiliateApplication::Answer::Type
Saved field type that determined how the scalar answer was validated.
151 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 151 required :type, enum: -> { GrowsurfRuby::AffiliateApplication::Answer::Type } |
#value ⇒ String, ...
Applicant answer represented as one validated string, number, or boolean.
157 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 157 required :value, -> { GrowsurfRuby::AffiliateApplication::Answer::Value } |
Instance Method Details
#to_hash ⇒ {
134 |
# File 'sig/growsurf_ruby/models/affiliate_application.rbs', line 134
def to_hash: -> {
|