Class: Hexpress::Nested::Matching

Inherits:
Object
  • Object
show all
Includes:
Hexpress::Nested
Defined in:
lib/hexpress/nested/matching.rb

Instance Attribute Summary

Attributes included from Wrapped

#close, #open

Instance Method Summary collapse

Methods included from Hexpress::Nested

#delimiter, #hexpression, #to_s

Methods included from Wrapped

#wrapping

Constructor Details

#initialize(&block) ⇒ Matching

Returns a new instance of Matching.



11
12
13
14
# File 'lib/hexpress/nested/matching.rb', line 11

def initialize(&block)
  @hexpression = Hexpress.new.instance_eval(&block)
  @open, @close = "[", "]"
end

Instance Method Details

#join_hexpressionObject



16
17
18
# File 'lib/hexpress/nested/matching.rb', line 16

def join_hexpression
  @hexpression.map(&method(:escape)).join(delimiter)
end