Sha256: 7d4cd1967dc333728d4857444281f6673e5b330ec2126eb08c1e0f24cfa6ba10

Contents?: true

Size: 342 Bytes

Versions: 5

Compression:

Stored size: 342 Bytes

Contents

module UpdateAttributes
  def update_attributes(attrs)
    attrs.each do |key, value|
      setter = "#{key}="
      send(setter, value) if respond_to?(setter)
      @logger.warn "#{key} is not a settable attribute on #{self.class}" unless respond_to?(setter)
    end
  end

  def <<(attrs)
    update_attributes attrs
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
albacore-0.2.5 lib/albacore/support/updateattributes.rb
albacore-0.2.4 lib/albacore/support/updateattributes.rb
albacore-0.2.3 lib/albacore/support/updateattributes.rb
albacore-0.2.2 lib/albacore/support/updateattributes.rb
albacore-0.2.0.preview2 lib/albacore/support/updateattributes.rb