def quantity=(quantity)
      if quantity.nil?
        fail ArgumentError, "quantity cannot be nil"
      end

      if quantity.to_s.length > 5
        fail ArgumentError, "invalid value for 'quantity', the character length must be smaller than or equal to 5."
      end

      if quantity.to_s.length < 1
        fail ArgumentError, "invalid value for 'quantity', the character length must be great than or equal to 1."
      end

      @quantity = quantity
    end
def quantity=(quantity)
      if quantity.nil?
        fail ArgumentError, "quantity cannot be nil"
      end

      if quantity.to_s.length > 5
        fail ArgumentError, "invalid value for 'quantity', the character length must be smaller than or equal to 5."
      end

      if quantity.to_s.length < 1
        fail ArgumentError, "invalid value for 'quantity', the character length must be great than or equal to 1."
      end

      @quantity = quantity
    end
Custom attribute writer method with validation
 @param [Object] quantity Value to be assigned