Module: ActivePodio::Updatable

Instance Method Summary collapse

Instance Method Details

#remove_nil_values(input_hash) ⇒ Object



10
11
12
13
14
15
# 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) ⇒ Object



4
5
6
7
8
# 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