Class: Parslet::Pattern::SimpleBind

Inherits:
SubtreeBind
  • Object
show all
Defined in:
lib/parslet/pattern/binding.rb

Overview

Binds a symbol to a simple subtree, one that is not either a sequence of elements or a collection of attributes.

Instance Attribute Summary

Attributes inherited from SubtreeBind

#symbol

Instance Method Summary collapse

Methods inherited from SubtreeBind

#inspect, #variable_name

Instance Method Details

#can_bind?(subtree) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/parslet/pattern/binding.rb', line 37

def can_bind?(subtree)
  not [Hash, Array].include?(subtree.class)
end