lib/stripe/stripe_object.rb
# Mass assigns attributes on the model.
#
# This is a version of +update_attributes+ that takes some extra options
# for internal use.
#
# ==== Attributes
#
# * +values+ - Hash of values to use to update the current attributes of
#   the object. If you are on ruby 2.7 or higher make sure to wrap in curly
#   braces to be ruby 3 compatible.
# * +opts+ - Options for +StripeObject+ like an API key that will be reused
#   on subsequent API calls.
#
# ==== Options
#
# * +:dirty+ - Whether values should be initiated as "dirty" (unsaved) and
#   which applies only to new StripeObjects being initiated under this
#   StripeObject. Defaults to true.
Mass assigns attributes on the model.
This is a version of +update_attributes+ that takes some extra options
for internal use.

Attributes

+values+ - Hash of values to use to update the current attributes of
the object. If you are on ruby 2.7 or higher make sure to wrap in curly
braces to be ruby 3 compatible.
+opts+ - Options for +StripeObject+ like an API key that will be reused
on subsequent API calls.

Options

+:dirty+ - Whether values should be initiated as "dirty" (unsaved) and
which applies only to new StripeObjects being initiated under this
StripeObject. Defaults to true.
Mass assigns attributes on the model . This is a version of + update_attributes + that takes some extra options for internal use . Attributes + values + - Hash of values to use to update the current attributes of the object . If you are on ruby 2 . 7 or higher make sure to wrap in curly braces to be ruby 3 compatible . + opts + - Options for + StripeObject + like an API key that will be reused on subsequent API calls . Options + : dirty + - Whether values should be initiated as " dirty " ( unsaved ) and which applies only to new StripeObjects being initiated under this StripeObject . Defaults to true .
def update_attributes(values, opts = {}, dirty: true)
      values.each do |k, v|
        add_accessors([k], values) unless metaclass.method_defined?(k.to_sym)
        @values[k] = Util.convert_to_stripe_object(v, opts)
        dirty_value!(@values[k]) if dirty
        @unsaved_values.add(k)
      end
    end
def update_attributes ( values , opts = { } , dirty : true ) values . each do | k , v | add_accessors ( [ k ] , values ) unless metaclass . method_defined? ( k . to_sym ) @values [ k ] = Util . convert_to_stripe_object ( v , opts ) dirty_value! ( @values [ k ] ) if dirty @unsaved_values . add ( k ) end end
Mass assigns attributes on the model.
Mass assigns attributes on the model .
values
opts
dirty