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.
Methods
def name -> Symbol
The field's name.
def owner -> Type[Object]
The class whose field it is.
def to_s -> String
#<Meta::FieldRef Post@views>.
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
def get(obj: T) -> U
The field of obj.
def set(obj: T, value: U) -> Void
Sets the field of obj to value.