Class: Whois::Scanners::Base
- Inherits:
-
Object
- Object
- Whois::Scanners::Base
- Defined in:
- lib/whois/scanners/base.rb
Direct Known Subclasses
BaseAfilias, BaseCocca2, BaseIcannCompliant, BaseIisse, BaseShared1, BaseShared2, BaseShared3, BaseWhoisd, Iana, Verisign, WhoisAtiTn, WhoisAudnsNetAu, WhoisCctldBy, WhoisCentralnicCom, WhoisCiraCa, WhoisCnnicCn, WhoisDenicDe, WhoisDnsHr, WhoisDomainregistryIe, WhoisFi, WhoisNc, WhoisNicIt, WhoisRnidsRs, WhoisSmallregistryNet, WhoisSrsNetNz, WhoisSx, WhoisTldEe, WhoisTucowsCom, WhoisYoursrsCom
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(settings = nil) ⇒ Base
constructor
A new instance of Base.
- #parse(content) ⇒ Object
Constructor Details
#initialize(settings = nil) ⇒ Base
Returns a new instance of Base.
16 17 18 |
# File 'lib/whois/scanners/base.rb', line 16 def initialize(settings = nil) @settings = settings || {} end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
14 15 16 |
# File 'lib/whois/scanners/base.rb', line 14 def settings @settings end |
Class Method Details
.tokenizer(name, &block) ⇒ Object
9 10 11 |
# File 'lib/whois/scanners/base.rb', line 9 def self.tokenizer(name, &block) define_method(name, &block) end |
Instance Method Details
#parse(content) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/whois/scanners/base.rb', line 20 def parse(content) # The temporary store. # Scanners may use this to store pointers, states or other flags. @tmp = {} # A super-simple AST store. @ast = {} @input = StringScanner.new(content) tokenize until @input.eos? @ast end |