Skip to content

Instantly share code, notes, and snippets.

@jcf
Created October 21, 2009 12:15
Show Gist options
  • Save jcf/215065 to your computer and use it in GitHub Desktop.
Save jcf/215065 to your computer and use it in GitHub Desktop.
def build_message
fields = PORTFOLIO_FIELDS.keys
values = fields.map { |field| self.send(field) }
message = Hash[*fields.zip(values).flatten]
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