Skip to content

Commit 1f895e1

Browse files
committed
Make actor_class accessible
1 parent 9dc5365 commit 1f895e1

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

lib/concurrent/actress/core.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Core
1111
include TypeCheck
1212
include Concurrent::Logging
1313

14-
attr_reader :reference, :name, :path, :executor, :terminated
14+
attr_reader :reference, :name, :path, :executor, :terminated, :actor_class
1515

1616
# @option opts [String] name
1717
# @option opts [Reference, nil] parent of an actor spawning this one
@@ -43,9 +43,9 @@ def initialize(opts = {}, &block)
4343

4444
@parent_core.add_child reference if @parent_core
4545

46-
@actress_class = actress_class = Child! opts.fetch(:class), Context
47-
args = opts.fetch(:args, [])
48-
initialized = Type! opts[:initialized], IVar, NilClass
46+
@actor_class = actress_class = Child! opts.fetch(:class), Context
47+
args = opts.fetch(:args, [])
48+
initialized = Type! opts[:initialized], IVar, NilClass
4949

5050
schedule_execution do
5151
begin

lib/concurrent/actress/core_delegations.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ def executor
3131
core.executor
3232
end
3333

34+
def actor_class
35+
core.actor_class
36+
end
37+
3438
alias_method :ref, :reference
39+
alias_method :actress_class, :actor_class
3540
end
3641
end
3742
end

lib/concurrent/actress/reference.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def message(message, ivar = nil)
5050
end
5151

5252
def to_s
53-
"#<#{self.class} #{path}>"
53+
"#<#{self.class} #{path} (#{actor_class})>"
5454
end
5555

5656
alias_method :inspect, :to_s

0 commit comments

Comments
 (0)