Data
ruby/spec describes 13 methods in core/data, and Metorex implements 12 of them. The parameters are what Method#parameters answers under Metorex.
Data#
Data#==: implemented, parameters[[:req, :other]]. Returnstrueifotheris the same class asself, and all members are equal.Data#deconstruct: implemented, parameters[]. Returns the values inselfas an array, to use in pattern matching: An example calling it.Data#deconstruct_keys: implemented, parameters[[:req, :keys]]. Returns a hash of the name/value pairs, to use in pattern matching. An example calling it.Data.define: implemented, parameters[[:rest, :names], [:block, :body]]. Defines a new Data class. An example calling it.Data#eql?: implemented, parameters[[:req, :other]]. Equality check that is used when two items of data are keys of a Hash. An example calling it.Data#hash: implemented, parameters[]. Redefines Object#hash (used to distinguish objects as Hash keys) so that data objects of the same class with same content would have the samehashvalue, and represented the same Hash key. An example calling it.Data#initialize: implemented, parameters[[:keyrest, :kwargs]]. An example calling it.Data#inspect: implemented, parameters[]. Returns a string representation ofself: An example calling it.Data#members: implemented, parameters[]. Returns the member names fromselfas an array: An example calling it.Data#to_h: implemented, parameters[]. Returns Hash representation of the data object. An example calling it.Data#to_s: implemented, parameters[]. Returns a string representation ofself: An example calling it.Data#with: implemented, parameters[[:rest, :args], [:keyrest, :kwargs]]. Returns a shallow copy ofself--- the instance variables ofselfare copied, but not the objects they reference. An example calling it.
DataClass#
DataClass#members: not implemented. An example calling it.
The method summaries are the first sentences of Ruby's own documentation for each method, read from MRI 4.0.6's ri data. Ruby's documentation is distributed under Ruby's license.