futuroscope 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2e406444d572ba1879ab2fb7963b81d27710dc5
4
- data.tar.gz: dc9f7d86d65224ae8b48da33930a9439c814c272
3
+ metadata.gz: 9a38124bea1c0800d134fa4600b8e5687556a8ed
4
+ data.tar.gz: 02e07ba6a3f537c994dee4301082e095b1c881cd
5
5
  SHA512:
6
- metadata.gz: 3c13e918f2e3fbefd5ba7af31febc58efe08324ee4e75d430a558fcf90b936621a83faded2af549945c0d8e83d8febc83c6480290b6f2770754156dc73ca31b5
7
- data.tar.gz: 327fdd0b92c35ac66b332af2b8ce7e7d25c13d01810213228b676dd10313480b38e072931a1c07c31be5260c0b476ff799f30b989daa25bdaa9e4e258858c511
6
+ metadata.gz: 2e3aa4fd153a337930353629fee374f6213e9890a9769af41a05bb58403266596f4fc7f4d1b06848ea846058beb6dc1876f834abc12947da026dc2e0209b791e
7
+ data.tar.gz: 038a7fb36f090ae38b36cad22d46f810a85428b293e1156f6f201f21a289f30bbe36ec190f5180291087f7f9b0453f3f842550215cfbb2c8d7705923d9259e6e
@@ -6,7 +6,7 @@ module Futuroscope
6
6
  # the future. That is, will block when the result is not ready until it is,
7
7
  # and will return it instantly if the thread's execution already finished.
8
8
  #
9
- class Future < BasicObject
9
+ class Future < Delegator
10
10
  extend ::Forwardable
11
11
 
12
12
  # Initializes a future with a block and starts its execution.
@@ -42,27 +42,19 @@ module Futuroscope
42
42
  # completed or return its value otherwise. Can be called multiple times.
43
43
  #
44
44
  # Returns the Future's block execution result.
45
- def future_value
45
+ def __getobj__
46
46
  resolved = resolved_future_value
47
47
 
48
48
  raise resolved[:exception] if resolved[:exception]
49
49
  resolved[:value]
50
50
  end
51
51
 
52
- def_delegators :future_value, :!, :!=, :==, :equal?
52
+ def_delegators :__getobj__, :class, :kind_of?, :is_a?, :clone
53
53
 
54
54
  private
55
55
 
56
56
  def resolved_future_value
57
57
  @resolved_future ||= @queue.pop
58
58
  end
59
-
60
- def method_missing(method, *args)
61
- future_value.send(method, *args)
62
- end
63
-
64
- def respond_to_missing?(method, include_private = false)
65
- future_value.respond_to?(method, include_private)
66
- end
67
59
  end
68
60
  end
@@ -1,3 +1,3 @@
1
1
  module Futuroscope
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: futuroscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy