Skip to content

Instantly share code, notes, and snippets.

@toreriklinnerud
Forked from jcf/ZippyHash.rb
Created October 21, 2009 19:53
Show Gist options
  • Save toreriklinnerud/215406 to your computer and use it in GitHub Desktop.
Save toreriklinnerud/215406 to your computer and use it in GitHub Desktop.
using graph, common method and present in our app, but not standard in ruby/rails
def build_message
message = PORTFOLIO_FIELDS.graph{|field, _| [field, send(field)] }
self.message = message.delete_if { |_, value| value.nil? }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment