Class: Decode::Language::Ruby::Call

Inherits:
Definition show all
Defined in:
lib/decode/language/ruby/call.rb

Overview

A Ruby-specific block which might carry other definitions.

Instance Attribute Summary

Attributes inherited from Definition

#comments, #language, #name, #parent

Instance Method Summary collapse

Methods inherited from Definition

#convert, #documentation, #initialize, #inspect, #location, #multiline?, #nested?, #nested_name, #path, #path_name, #qualified_name, #start_with?, #text

Constructor Details

This class inherits a constructor from Decode::Definition

Instance Method Details

#container?Boolean

A block can sometimes be a container for other definitions.

Returns:

  • (Boolean)


14
15
16
# File 'lib/decode/language/ruby/call.rb', line 14

def container?
	false
end

#long_formObject

The long form of the class. e.g. ‘foo(:bar)`.



26
27
28
29
30
31
32
# File 'lib/decode/language/ruby/call.rb', line 26

def long_form
	if @node.location.line == @node.location.last_line
		@node.location.expression.source
	else
		self.short_form
	end
end

#qualified_formObject

The fully qualified name of the block. e.g. ‘class ::Barnyard::Dog`.



36
37
38
# File 'lib/decode/language/ruby/call.rb', line 36

def qualified_form
	self.qualified_name
end

#short_formObject

The short form of the class. e.g. ‘foo`.



20
21
22
# File 'lib/decode/language/ruby/call.rb', line 20

def short_form
	@name.to_s
end