module ActivePodio::Updatable

Public Instance Methods

remove_nil_values(input_hash) click to toggle source
# File lib/podio/active_podio/updatable.rb, line 10
def remove_nil_values(input_hash)
  input_hash.inject({}) do |hash, (key, value)|
    hash[key] = value unless value.nil?
    hash
  end
end
update_attributes(attributes) click to toggle source
# File lib/podio/active_podio/updatable.rb, line 4
def update_attributes(attributes)
  attributes.each do |key, value|
    self.send("#{key}=".to_sym, value.presence)
  end
end