Class: SkypeR::Parser::ResponseStatement

Inherits:
ResponseBase
  • Object
show all
Defined in:
lib/skyper/response.rb

Overview

<response_statement> := [<command_id>] <response>

| [<command_id>] error

Instance Method Summary collapse

Constructor Details

#initializeResponseStatement

Returns a new instance of ResponseStatement.



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/skyper/response.rb', line 22

def initialize
  @parser = lambda do
    Yaparc::AltParser.new(Yaparc::SeqParser.new(Yaparc::ZeroOneParser.new(CommandID.new),
                                                Response.new) do |command_id, response|
                            response
                          end,
                          Yaparc::SeqParser.new(Yaparc::ZeroOneParser.new(CommandID.new),
                                                Error.new) do |command_id, error|
                            error
                          end)
  end
end