Class: LibRubyParser::MagicComment
- Inherits:
-
Object
- Object
- LibRubyParser::MagicComment
- Defined in:
- lib/lib-ruby-parser.rb
Overview
Representation of a magic comment in Ruby
Instance Attribute Summary collapse
-
#key_l ⇒ Loc
Location of the “key”.
-
#kind ⇒ Symbol
Kind of a magic comment, can be.
-
#value_l ⇒ Loc
Location of the “value”.
Instance Method Summary collapse
-
#initialize(kind:, key_l:, value_l:) ⇒ MagicComment
constructor
A new instance of MagicComment.
Constructor Details
#initialize(kind:, key_l:, value_l:) ⇒ MagicComment
Returns a new instance of MagicComment.
151 152 153 154 155 |
# File 'lib/lib-ruby-parser.rb', line 151 def initialize(kind:, key_l:, value_l:) @kind = kind @key_l = key_l @value_l = value_l end |
Instance Attribute Details
#key_l ⇒ Loc
Location of the “key”
137 138 139 |
# File 'lib/lib-ruby-parser.rb', line 137 def key_l @key_l end |
#kind ⇒ Symbol
Kind of a magic comment, can be
- +encoding+
- +frozen_string_literal+
- +warn_indent+
- +shareable_constant_value+
128 129 130 |
# File 'lib/lib-ruby-parser.rb', line 128 def kind @kind end |
#value_l ⇒ Loc
Location of the “value”
146 147 148 |
# File 'lib/lib-ruby-parser.rb', line 146 def value_l @value_l end |