class Prism::MagicComment

This represents a magic comment that was encountered during parsing.

def deconstruct_keys(keys)

Implement the hash pattern matching interface for MagicComment.
def deconstruct_keys(keys)
  { key_loc: key_loc, value_loc: value_loc }
end

def initialize(key_loc, value_loc)

Create a new magic comment object with the given key and value locations.
def initialize(key_loc, value_loc)
  @key_loc = key_loc
  @value_loc = value_loc
end

def inspect

Returns a string representation of this magic comment.
def inspect
  "#<Prism::MagicComment @key=#{key.inspect} @value=#{value.inspect}>"
end

def key

Returns the key of the magic comment by slicing it from the source code.
def key
  key_loc.slice
end

def value

Returns the value of the magic comment by slicing it from the source code.
def value
  value_loc.slice
end