support/ruby/collins-client/lib/collins/option.rb
# If the option value is defined, apply the specified block to that value
#
# @example
#  Option("15").map{|i| i.to_i}.get == 15
#
# @yieldparam [Object] block The current value
# @yieldreturn [Object] The new value
# @return [Option<Object>] Optional value
If the option value is defined, apply the specified block to that value
If the option value is defined apply the specified block to that value
def map &block
      if empty? then
        None.new
      else
        Some.new(block.call(get))
      end
    end
def map & block if empty? then None . new else Some . new ( block . call ( get ) ) end end
If the option value is defined, apply the specified block to that value
If the option value is defined apply the specified block to that value
The new value
The new value
Object
None
Option<Object>
block
block The current value
block The current value
example
None