Skip to content

Instantly share code, notes, and snippets.

@olistik
Last active Aug 29, 2015
Embed
What would you like to do?
Be Brave in Ruby-land
module Brave
def self.be(exception_classes = [NoMethodError])
begin
yield
rescue *exception_classes => e
end
end
end
require 'hashie'
require 'monads'
module Brave
def self.be(exception_classes = [NoMethodError])
begin
yield
rescue *exception_classes => e
end
end
def self.wrap_hash(object)
Monads::Optional.new(Hashie::Mash.new(object))
end
end
Brave.wrap_hash(params).profile.resume.tempfile.path.value
require 'hashie'
require 'monads'
Monads::Optional.new(Hashie::Mash.new(params)).profile.resume.tempfile.path.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment