Class: Decode::Language::Ruby::Attribute
- Inherits:
-
Definition
- Object
- Symbol
- Definition
- Decode::Language::Ruby::Attribute
- Defined in:
- lib/decode/language/ruby/attribute.rb
Overview
A Ruby-specific attribute.
Instance Attribute Summary
Attributes inherited from Definition
Attributes inherited from Symbol
#kind, #language, #name, #parent
Instance Method Summary collapse
-
#keyword ⇒ String
The keyword that defined the attribute.
-
#short_form ⇒ Object
The short form of the attribute.
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
#keyword ⇒ String
The keyword that defined the attribute.
30 31 32 |
# File 'lib/decode/language/ruby/attribute.rb', line 30 def keyword @node.children[1] end |
#short_form ⇒ Object
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 |