Class
This represents a magic comment that was encountered during parsing.
Attributes
Class Methods
dev
View on GitHub
# File tmp/rubies/ruby-master/lib/prism/parse_result.rb, line 761
def initialize(key_loc, value_loc)
@key_loc = key_loc
@value_loc = value_loc
end
Create a new magic comment object with the given key and value locations.
Instance Methods
#
dev
View on GitHub
# File tmp/rubies/ruby-master/lib/prism/parse_result.rb, line 769
def key
key_loc.slice
end
Returns the key of the magic comment by slicing it from the source code.
#
dev
View on GitHub
# File tmp/rubies/ruby-master/lib/prism/parse_result.rb, line 776
def value
value_loc.slice
end
Returns the value of the magic comment by slicing it from the source code.