daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def camelize_props(hash)  
  2.     props = hash.reduce({}) do |acc, (key, value)|  
  3.       if value.respond_to?(:serializable_hash)  
  4.         acc.merge(key => value.serializable_hash)  
  5.       else  
  6.         acc.merge(key => value)  
  7.       end  
  8.     end  
  9.  
  10.     props.deep_transform_keys! { |key| key.to_s.camelize(:lower) }  
  11.  
  12.     props  
  13.   end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top