Class: Adhearsion::Translator::Asterisk::Channel

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/adhearsion/translator/asterisk/channel.rb

Constant Summary collapse

NORMALIZATION_REGEXP =
/^(?<prefix>Bridge\/)*(?<name>[^<>]*)(?<suffix><.*>)*$/.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(other) ⇒ Object


11
12
13
# File 'lib/adhearsion/translator/asterisk/channel.rb', line 11

def self.new(other)
  other.is_a?(self) ? other : super
end

Instance Method Details

#bridged?Boolean

Returns:

  • (Boolean)

27
28
29
# File 'lib/adhearsion/translator/asterisk/channel.rb', line 27

def bridged?
  @bridged ||= (prefix || suffix)
end

#nameObject


15
16
17
# File 'lib/adhearsion/translator/asterisk/channel.rb', line 15

def name
  matchdata[:name]
end

#prefixObject


19
20
21
# File 'lib/adhearsion/translator/asterisk/channel.rb', line 19

def prefix
  matchdata[:prefix]
end

#suffixObject


23
24
25
# File 'lib/adhearsion/translator/asterisk/channel.rb', line 23

def suffix
  matchdata[:suffix]
end

#to_sObject


31
32
33
# File 'lib/adhearsion/translator/asterisk/channel.rb', line 31

def to_s
  __getobj__
end