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, #multiline?, #nested?, #nested_name, #path, #qualified_name, #start_with?, #text, #to_s

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)


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

def container?
	false
end

#long_formObject

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



41
42
43
44
45
46
47
# File 'lib/decode/language/ruby/call.rb', line 41

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`.



51
52
53
# File 'lib/decode/language/ruby/call.rb', line 51

def qualified_form
	self.qualified_name
end

#short_formObject

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



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

def short_form
	@name.to_s
end