DecodeSourceDecodeLanguageRubyAttribute

class Attribute

A Ruby-specific attribute.

Definitions

def short_form

The short form of the attribute. e.g. attr :value.

Implementation

def short_form
	case @node&.type
	when :block_node
		"#{@name} { ... }"
	else
		@node&.location&.slice || @name
	end
end

def long_form

Generate a long form representation of the attribute.

Implementation

def long_form
	if @node&.location&.start_line == @node&.location&.end_line
		@node.location.slice
	else
		short_form
	end
end