Class: Duby::AST::JRubyAst::HashNode
- Inherits:
-
Object
- Object
- Duby::AST::JRubyAst::HashNode
- Defined in:
- lib/duby/transform.rb
Instance Method Summary collapse
-
#signature(parent) ⇒ Object
Create a signature definition using a literal hash syntax.
- #transform(transformer, parent) ⇒ Object
Instance Method Details
#signature(parent) ⇒ Object
Create a signature definition using a literal hash syntax
687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 |
# File 'lib/duby/transform.rb', line 687 def signature(parent) # flag this as a declaration, so it transforms to a noop @declaration = true arg_types = {:return => nil} list = list_node.child_nodes.to_a list.each_index do |index| if index % 2 == 0 if SymbolNode === list[index] && list[index].name == 'return' arg_types[:return] = list[index + 1].type_reference(parent) else arg_types[list[index].name.intern] = list[index + 1].type_reference(parent) end end end return arg_types end |