Class: GrowsurfRuby::Models::AffiliateApplication::Answer::Value
- Inherits:
-
Object
- Object
- GrowsurfRuby::Models::AffiliateApplication::Answer::Value
- Defined in:
- lib/growsurf_ruby/models/affiliate_application.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(field_id: nil, label: nil, type: nil, value: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see GrowsurfRuby::Models::AffiliateApplication::Answer for more details.
Methods included from Internal::Type::Converter
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
Constructor Details
#initialize(field_id: nil, label: nil, type: nil, value: nil) ⇒ Object
Some parameter documentations has been truncated, see GrowsurfRuby::Models::AffiliateApplication::Answer for more details.
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 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 171 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 |
Class Method Details
.===(other) ⇒ Object
177 178 179 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 177 def self.===(other) scalar?(other) end |
.coerce(value, state:) ⇒ Object
181 182 183 184 185 186 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 181 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 |
.to_sorbet_type ⇒ Object
188 189 190 |
# File 'lib/growsurf_ruby/models/affiliate_application.rb', line 188 def self.to_sorbet_type T.any(String, Integer, Float, T::Boolean) end |