Class: Prism::Reflection::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/prism/reflection.rb,
sig/generated/prism/reflection.rbs

Overview

A field represents a single piece of data on a node. It is the base class for all other field types.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Field

Initializes the field with the given name.

: (Symbol name) -> void

Parameters:

  • name (Symbol)


29
30
31
# File 'lib/prism/reflection.rb', line 29

def initialize(name)
  @name = name
end

Instance Attribute Details

#name ⇒ Symbol (readonly)

The name of the field.

Returns:

  • (Symbol)


24
25
26
# File 'lib/prism/reflection.rb', line 24

def name
  @name
end