Class: NT54::Parser::Visitors::WaitForCountryCodeStart

Inherits:
NT54::Parser::Visitor show all
Defined in:
lib/nt54/parser/visitors/wait_for_country_code_start.rb

Instance Attribute Summary

Attributes inherited from NT54::Parser::Visitor

#number

Instance Method Summary collapse

Methods inherited from NT54::Parser::Visitor

#initialize, #to_sym

Constructor Details

This class inherits a constructor from NT54::Parser::Visitor

Instance Method Details

#accept(keypress) ⇒ Object



5
6
7
8
9
10
# File 'lib/nt54/parser/visitors/wait_for_country_code_start.rb', line 5

def accept(keypress)
  super
  raise "Expected 5, got #{keypress}" unless keypress.to_s == "5"
  @number.country_code << keypress
  :country_code_started
end