Module: Ruby2CExtension::Tools::EnsureNodeTypeMixin
- Included in:
- CFunction::Base, CommonNodeComp, Plugins::CaseOptimize
- Defined in:
- lib/ruby2cext/tools.rb
Instance Method Summary collapse
Instance Method Details
#ensure_node_type(node, expected_types) ⇒ Object
74 75 76 77 78 79 |
# File 'lib/ruby2cext/tools.rb', line 74 def ensure_node_type(node, expected_types) expected_types = [expected_types] unless Array === expected_types unless node && expected_types.index(node.first) raise Ruby2CExtError, "unexpected node type: expected #{expected_types.join(" or ")}, found #{node.inspect}" end end |