Class: DParse::Parsers::String
- Inherits:
-
DParse::Parser
- Object
- DParse::Parser
- DParse::Parsers::String
- Defined in:
- lib/d-parse/parsers/highlevel/string.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ String
constructor
A new instance of String.
Methods inherited from DParse::Parser
#apply, #bind, #capture, #compact, #expectation_message, #first, #flatten, #ignore, #inspect, #map, #match?, #read, #second, #select_even, #select_odd, #to_s
Constructor Details
#initialize ⇒ String
Returns a new instance of String.
8 9 10 |
# File 'lib/d-parse/parsers/highlevel/string.rb', line 8 def initialize(*) raise ArgumentError, "#{self.class} is not supposed to be initialized" end |
Class Method Details
.new(string) ⇒ Object
4 5 6 |
# File 'lib/d-parse/parsers/highlevel/string.rb', line 4 def self.new(string) DParse::Parsers::Seq.new(*string.chars.map { |c| DParse::Parsers::Char.new(c) }) end |