Class: Peggy::Optional
- Defined in:
- lib/parse/builder.rb
Overview
Matcher of 0 or 1 time.
Constant Summary
Constants inherited from Multiple
Instance Attribute Summary
Attributes inherited from Multiple
Attributes included from OneChild
Instance Method Summary collapse
-
#initialize ⇒ Optional
constructor
A new instance of Optional.
-
#to_s ⇒ Object
Convert element to String.
Methods inherited from Multiple
Methods included from OneChild
Methods inherited from Element
Constructor Details
#initialize ⇒ Optional
Returns a new instance of Optional.
174 175 176 |
# File 'lib/parse/builder.rb', line 174 def initialize super 0..1 end |
Instance Method Details
#to_s ⇒ Object
Convert element to String.
179 180 181 |
# File 'lib/parse/builder.rb', line 179 def to_s "#{wrap}?" end |