codegram / futuroscope

Yet another Futures implementation in Ruby
MIT License
210 stars 13 forks source link

Is future_value still a valid method? #6

Closed bploetz closed 11 years ago

bploetz commented 11 years ago

The documentation at https://github.com/codegram/futuroscope#simple-futures says you can call the future_value method on a Future object, but it fails for me:

1.9.3p327 :001 > require 'futuroscope/convenience'
 => true 
1.9.3p327 :002 > test = future {sleep(1); "hi"}
 => "hi" 
1.9.3p327 :003 > test.future_value
NoMethodError: undefined method `future_value' for "hi":Futuroscope::Future
    from (irb):3
    from /Users/bploetz/.rvm/rubies/ruby-1.9.3-p327/bin/irb:16:in `<main>'

Is the documentation out of date, or is this a bug? I couldn't find a future_value method defined anywhere in the latest code......

josepjaume commented 11 years ago

Hey! I know I'm really late to the party but future_value was converted to __getobj__ in order to use ruby's builtin SimpleDelegator. Either way, I've re-added future_value as an alias since it looks convenient and made a bugfix release (0.1.5).

Thanks for pointing this out!