module T::Props::ClassMethods
def prop(name, cls, rules={})
-
(void)-
Options Hash:
(**rules)-
:redaction(Symbol, Array) -- A redaction directive that may -
:override(T::Boolean) -- It is an error to redeclare a -
:array(Class, T::Props::CustomType) -- If set, specifies the -
:immutable(T::Boolean) -- If true, this prop cannot be -
:factory(Proc) -- A `Proc` that will be called to -
:default(Object) -- A default value that will be set -
:foreign(Model, Symbol, Proc) -- A model class that this -
:ifunset(Object) -- A value to be returned if this -
:dont_store(T::Boolean) -- If true, this property will -
:enum(Array) -- An array of legal values; The -
:optional(T::Boolean, Symbol) -- If `true`, this property
Parameters:
-
rules(Hash) -- Options to control this property's behavior. -
cls(Class, T::Props::CustomType) -- (String) The type of this -
name(Symbol) -- The name of this property
def prop(name, cls, rules={}) cls = T::Utils.coerce(cls) if !cls.is_a?(Module) decorator.prop_defined(name, cls, rules) end