Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Data#members

() -> ::Array[::Symbol]
members → array_of_symbols

Returns the member names from self as an array:

Example
Measure = Data.define(:amount, :unit)
distance = Measure[10, 'km']

distance.members #=> [:amount, :unit]
See also .members #inspect #to_h #hash also in 4.1 · 4.0 · 3.3 · 3.2