Decode SourceDecodeLanguageRubyMethod

class Method

A Ruby-specific method.

Definitions

def short_form

The short form of the method. e.g. def puts.

Implementation

def short_form
	@node.location.keyword.join(@node.location.name).source
end

def arguments_node

The node which contains the function arguments.

Implementation

def arguments_node
	if node = @node.children[1]
		if node.location.expression
			return node
		end
	end
end

def long_form

The long form of the method. e.g. def puts(*lines, separator: "\n").

Implementation

def long_form
	if arguments_node = self.arguments_node
		@node.location.keyword.join(
			arguments_node.location.expression
		).source
	else
		self.short_form
	end
end

def qualified_form

The fully qualified name of the block. e.g. ::Barnyard#foo.

Implementation

def qualified_form
	self.qualified_name
end