Class: YARP::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/yarp.rb,
ext/yarp/extension.c

Overview

This represents a comment that was encountered during parsing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, location) ⇒ Comment

Returns a new instance of Comment.



106
107
108
109
# File 'lib/yarp.rb', line 106

def initialize(type, location)
  @type = type
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



104
105
106
# File 'lib/yarp.rb', line 104

def location
  @location
end

#typeObject (readonly)

Returns the value of attribute type.



104
105
106
# File 'lib/yarp.rb', line 104

def type
  @type
end

Instance Method Details

#deconstruct_keys(keys) ⇒ Object



111
112
113
# File 'lib/yarp.rb', line 111

def deconstruct_keys(keys)
  { type: type, location: location }
end