Covered many times in the Dynamic Components forum category.
However, using Ruby introspection you can discover the built-in methods that the extension itself uses.
dc = $dc_observers.get_latest_class
#=> #<DynamicComponentsV1:0x0000020ab91cfdc ... >
dc.public_methods(false).sort
# I won't paste the output here for brevity sake, do this at the Console
# see the full list of methods that the class instance has defined.
dc.method(:set_attribute).arity
#=> -4
# Ie, (negative denotes variable, 3 required and additional optional args.)
dc.method(:set_attribute).parameters
=> [
[:req, :entity], [:req, :name], [:req, :value], [:opt, :formula],
[:opt, :label], [:opt, :access], [:opt, :options], [:opt, :formlabel],
[:opt, :units], [:opt, :error], [:opt, :formulaunits], [:opt, :name_prefix],
[:opt, :can_delete_formlabel]
]
Playing around with changing DC attribute parameters and viewing using Aerilius’ Attribute Inspector, here is a preliminary list for argument values …
All of the default values for optional arguments are nil
(which means the extension will not change nor create that attribute;) … except for:
name_prefix
which is an empty string.can_delete_formlabel
which is likely Boolean
The list of valid access
settings include:
"NONE"
if consumers can’t see or edit this attribute"VIEW"
if consumers can see this attribute"TEXTBOX"
if consumer can enter a value for this attribute"LIST"
if consumers can select a value from a list
This options
is a ampersand separated string of name/value pairs that looks like a
web query string. It comes into play if the access setting for an attributeis set to “LIST.”
- EXAMPLE:
"Small=10&Medium=15&Really+Large=25"
The valid display units
are:
"DEFAULT"
(user’s model units)"STRING"
"INTEGER"
"FLOAT"
"DEGREES"
"PERCENT"
"DOLLARS"
"EUROS"
"YEN"
"BOOLEAN"
(true or false)"INCHES"
"FEET"
"YARDS"
"POUNDS"
(weight)"CENTIMETERS"
"MILLIMETERS"
"METERS"
"KILOGRAMS"
Some of the valid formulaunits
are:
"DEFAULT"
"LENGTH"
"FLOAT"
"STRING"
"INCHES"
… perhaps more.