Class: Rbgo::SyncArray
- Inherits:
-
Object
- Object
- Rbgo::SyncArray
- Defined in:
- lib/rbgo/synchronized_collection.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args, &blk) ⇒ SyncArray
constructor
A new instance of SyncArray.
Constructor Details
#initialize(*args, &blk) ⇒ SyncArray
Returns a new instance of SyncArray.
15 16 17 18 |
# File 'lib/rbgo/synchronized_collection.rb', line 15 def initialize(*args, &blk) @a = Array.new(*args, &blk) @a.extend(MonitorMixin) end |
Class Method Details
.[](*args) ⇒ Object
6 7 8 |
# File 'lib/rbgo/synchronized_collection.rb', line 6 def self.[](*args) SyncArray.new(Array.[](*args)) end |
.try_convert(obj) ⇒ Object
10 11 12 13 |
# File 'lib/rbgo/synchronized_collection.rb', line 10 def self.try_convert(obj) a = Array.try_convert(obj) a.nil? ? nil : SyncArray.new(a) end |