Class: Adhearsion::VoIP::Asterisk::Manager::DelegatingAsteriskManagerInterfaceLexer
- Inherits:
-
AbstractAsteriskManagerInterfaceStreamLexer
- Object
- AbstractAsteriskManagerInterfaceStreamLexer
- Adhearsion::VoIP::Asterisk::Manager::DelegatingAsteriskManagerInterfaceLexer
- Defined in:
- lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb
Constant Summary
Constants inherited from AbstractAsteriskManagerInterfaceStreamLexer
AbstractAsteriskManagerInterfaceStreamLexer::BUFFER_SIZE
Instance Attribute Summary
Attributes inherited from AbstractAsteriskManagerInterfaceStreamLexer
Instance Method Summary collapse
- #error_received(message) ⇒ Object
-
#initialize(delegate, method_delegation_map = nil) ⇒ DelegatingAsteriskManagerInterfaceLexer
constructor
A new instance of DelegatingAsteriskManagerInterfaceLexer.
- #message_received(message) ⇒ Object
- #syntax_error_encountered(ignored_chunk) ⇒ Object
Methods inherited from AbstractAsteriskManagerInterfaceStreamLexer
#<<, #extend_buffer_with, #resume!
Constructor Details
#initialize(delegate, method_delegation_map = nil) ⇒ DelegatingAsteriskManagerInterfaceLexer
Returns a new instance of DelegatingAsteriskManagerInterfaceLexer.
1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb', line 1724 def initialize(delegate, method_delegation_map=nil) super() @delegate = delegate @message_received_method = method_delegation_map && method_delegation_map.has_key?(:message_received) ? method_delegation_map[:message_received] : :message_received @error_received_method = method_delegation_map && method_delegation_map.has_key?(:error_received) ? method_delegation_map[:error_received] : :error_received @syntax_error_method = method_delegation_map && method_delegation_map.has_key?(:syntax_error_encountered) ? method_delegation_map[:syntax_error_encountered] : :syntax_error_encountered end |
Instance Method Details
#error_received(message) ⇒ Object
1742 1743 1744 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb', line 1742 def error_received() @delegate.send(@error_received_method, ) end |
#message_received(message) ⇒ Object
1738 1739 1740 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb', line 1738 def () @delegate.send(@message_received_method, ) end |
#syntax_error_encountered(ignored_chunk) ⇒ Object
1746 1747 1748 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb', line 1746 def syntax_error_encountered(ignored_chunk) @delegate.send(@syntax_error_method, ignored_chunk) end |