Class: ABNF::Char

Inherits:
Satisfies show all
Defined in:
lib/abnf.rb

Overview

Core Rules

I tried to preserve the RFC names where possible.

Direct Known Subclasses

CR, DQuote, HTab, LF, SP

Instance Method Summary collapse

Methods inherited from Satisfies

#match

Constructor Details

#initialize(c) ⇒ Char

Returns a new instance of Char.



225
226
227
# File 'lib/abnf.rb', line 225

def initialize(c)
  @char = c.ord
end

Instance Method Details

#predicate(c) ⇒ Object



229
230
231
# File 'lib/abnf.rb', line 229

def predicate(c)
  c == @char
end