Sha256: a4556ff2f95692303b87774f48fafb1ff6cf32b678659253e62bdee1fb1a300a
Contents?: true
Size: 593 Bytes
Versions: 60
Compression:
Stored size: 593 Bytes
Contents
# frozen_string_literal: true class LHS::Record module AttributeAssignment extend ActiveSupport::Concern def assign_attributes(new_attributes) if !new_attributes.respond_to?(:stringify_keys) raise ArgumentError, "When assigning attributes, you must pass a hash as an argument, #{new_attributes.class} passed." end return if new_attributes.empty? _assign_attributes(new_attributes) end private def _assign_attributes(attributes) attributes.each do |key, value| public_send(:"#{key}=", value) end end end end
Version data entries
60 entries across 60 versions & 1 rubygems