Class: MPlayer::CallbackList
- Inherits:
-
Array
- Object
- Array
- MPlayer::CallbackList
- Defined in:
- lib/easy_mplayer/callback.rb
Overview
:nodoc:all
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(list_name) ⇒ CallbackList
constructor
A new instance of CallbackList.
- #register(opts) ⇒ Object
- #run!(args) ⇒ Object
Constructor Details
#initialize(list_name) ⇒ CallbackList
Returns a new instance of CallbackList.
22 23 24 |
# File 'lib/easy_mplayer/callback.rb', line 22 def initialize(list_name) @name = list_name.to_sym end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
20 21 22 |
# File 'lib/easy_mplayer/callback.rb', line 20 def name @name end |
Class Method Details
.all ⇒ Object
37 38 39 |
# File 'lib/easy_mplayer/callback.rb', line 37 def all @all ||= Hash.new end |
.find(name) ⇒ Object
41 42 43 |
# File 'lib/easy_mplayer/callback.rb', line 41 def find(name) all[name.to_sym] ||= new(name) end |
.register(opts) ⇒ Object
45 46 47 |
# File 'lib/easy_mplayer/callback.rb', line 45 def register(opts) find(opts[:name]).register(opts) end |
.run!(name, args) ⇒ Object
49 50 51 |
# File 'lib/easy_mplayer/callback.rb', line 49 def run!(name, args) find(name).run!(args) end |