From: adam.pahlevi@... Date: 2016-11-14T06:18:55+00:00 Subject: [ruby-core:78118] [Ruby trunk Bug#12933] Add Some and Optional Issue #12933 has been reported by Adam Pahlevi Baihaqi. ---------------------------------------- Bug #12933: Add Some and Optional https://bugs.ruby-lang.org/issues/12933 * Author: Adam Pahlevi Baihaqi * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- What if we have Optional and None as a class, and which we can use like this: ```ruby have_data = Optional(5).get # returns 5 have_data = Some(nil) # raise error have_data = Some(operation).expect("cannot be nil") # raise cannot be nil if operation returned nil ``` -- https://bugs.ruby-lang.org/ Unsubscribe: