Class: AsteriskManager::Conference
- Inherits:
-
Object
- Object
- AsteriskManager::Conference
- Defined in:
- lib/asterisk-manager/conference.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #channels ⇒ Object
-
#initialize(arguments = {}) ⇒ Conference
constructor
A new instance of Conference.
Constructor Details
#initialize(arguments = {}) ⇒ Conference
Returns a new instance of Conference.
5 6 7 |
# File 'lib/asterisk-manager/conference.rb', line 5 def initialize(arguments = {}) self.name = arguments[:name] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/asterisk-manager/conference.rb', line 3 def name @name end |
Class Method Details
.conferences ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/asterisk-manager/conference.rb', line 15 def self.conferences conferences = {} Channel.channels.values.each do |channel| if channel.application_name == 'ConfBridge' name = channel.application_data.split(',').first conferences[name] = new(name: name) end end conferences end |
.for_name(name) ⇒ Object
26 27 28 |
# File 'lib/asterisk-manager/conference.rb', line 26 def self.for_name(name) conferences[name] ||= new(name: name) end |
Instance Method Details
#channels ⇒ Object
9 10 11 12 13 |
# File 'lib/asterisk-manager/conference.rb', line 9 def channels Channel.channels.values.select do |channel| channel.application_name == 'ConfBridge' && channel.application_data.split(',').first == name end end |