Class: Decode::Language::Ruby::Attribute

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

Overview

A Ruby-specific attribute.

Instance Attribute Summary

Attributes inherited from Definition

#comments

Attributes inherited from Symbol

#kind, #language, #name, #parent

Instance Method Summary collapse

Methods inherited from Definition

#container?, #documentation, #initialize, #long_form, #multiline?, #nested?, #qualified_form, #text

Methods inherited from Symbol

#initialize, #inspect, #key, #lexical_path, #path, #qualified_name

Constructor Details

This class inherits a constructor from Decode::Definition

Instance Method Details

#keywordString

The keyword that defined the attribute.

Returns:

  • (String)


30
31
32
# File 'lib/decode/language/ruby/attribute.rb', line 30

def keyword
	@node.children[1]
end

#short_formObject

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



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

def short_form
	"#{self.keyword} #{@name.inspect}"
end