Class: Hexpress::Values::Either
- Includes:
- Hexpress::Values, Wrapped
- Defined in:
- lib/hexpress/values/either.rb,
lib/hexpress/verbal_expressions.rb
Instance Attribute Summary
Attributes included from Hexpress::Values
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(*values) ⇒ Either
constructor
A new instance of Either.
- #open ⇒ Object
- #to_s ⇒ Object
Methods included from Wrapped
Methods included from Hexpress::Values
Constructor Details
#initialize(*values) ⇒ Either
Returns a new instance of Either.
13 14 15 16 17 |
# File 'lib/hexpress/values/either.rb', line 13 def initialize(*values) @values = values @delimiter = "|" @open, @close = "(?:", ")" end |
Instance Method Details
#close ⇒ Object
25 26 27 |
# File 'lib/hexpress/verbal_expressions.rb', line 25 def close "])" end |
#open ⇒ Object
21 22 23 |
# File 'lib/hexpress/verbal_expressions.rb', line 21 def open "(?:[" end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/hexpress/values/either.rb', line 19 def to_s "#{open}#{values.join(delimiter)}#{close}" end |