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.

Constant Summary collapse

TYPES =
[:inline, :embdoc, :__END__]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, location) ⇒ Comment

Returns a new instance of Comment.



116
117
118
119
# File 'lib/yarp.rb', line 116

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



114
115
116
# File 'lib/yarp.rb', line 114

def location
  @location
end

#typeObject (readonly)

Returns the value of attribute type.



114
115
116
# File 'lib/yarp.rb', line 114

def type
  @type
end

Instance Method Details

#deconstruct_keys(keys) ⇒ Object



121
122
123
# File 'lib/yarp.rb', line 121

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