class Meta::FieldRef[T, U]

A field of T of type U as a value (docs/14 §5): what ClassDef#def_field and ClassDef#field_ref give. It is read and written only in a block given to def_method that captures it, where it is baked: ref.get(self) is the field read @name and ref.set(self, v) the write (the field must be var). The object is the generated method's self (for now: T is the static def's view of the class, the field the class generated into's). Made only by those two methods: it has its name and owner, and nothing else observable.

<prelude>:299

Methods

def name -> Symbol

The field's name.

<prelude>:308

def owner -> Type[Object]

The class whose field it is.

<prelude>:310

def to_s -> String

#<Meta::FieldRef Post@views>.

<prelude>:312

def inspect -> String

A developer-readable representation, as p prints it: strings quoted, collections with their elements' inspect, an object with its fields (#<Point @x=1, @y=2>).

from Object

<prelude>:313

def get(obj: T) -> U

The field of obj.

<prelude>:315

def set(obj: T, value: U) -> Void

Sets the field of obj to value.

<prelude>:317