Module: UpdateAttributes

Included in:
Albacore::Task, NCover::CodeCoverageBase, NCover::CyclomaticComplexity, NCover::ReportFilterBase
Defined in:
lib/albacore/support/updateattributes.rb

Instance Method Summary collapse

Instance Method Details

#<<(attrs) ⇒ Object



10
11
12
# File 'lib/albacore/support/updateattributes.rb', line 10

def <<(attrs)
  update_attributes attrs
end

#update_attributes(attrs) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/albacore/support/updateattributes.rb', line 2

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