class
Unibilium::Extensions
- Unibilium::Extensions
- Reference
- Object
Defined in:
extensions.crConstructors
Instance Method Summary
- #[](arg)
- #[]?(arg)
-
#add(name, value : ValidType)
Adds the capability extension named name, and set it to value.
- #count_bool
- #count_num
- #count_str
-
#delete(name)
Deletes the capability name.
- #destroy
-
#get?(name)
Gets the value of extension name, dispatched on its declared type, or
nilif the extension does not exist (or is a string with no value). - #get_bool(name)
- #get_bool?(name)
-
#get_bool_name(i)
unibi_get_ext_bool_namereturns NULL when i is out of range (>=#count_bool). - #get_num(name)
- #get_num?(name)
-
#get_num_name(i)
unibi_get_ext_num_namereturns NULL when i is out of range (>=#count_num). - #get_str(name)
- #get_str?(name)
-
#get_str_name(i)
unibi_get_ext_str_namereturns NULL when i is out of range (>=#count_str). -
#has?(name)
Returns
trueif the extension named name exists. -
#rename(old old_name, new new_name)
Gives a new name to the capability old_name.
-
#saved_cap_extensions : UniqueHash
The capability-extension index, built lazily on first access.
-
#set(name, value)
Sets the value of capability name to value, adding it first if it doesn't exist.
- #to_unsafe : Pointer(Void)
Constructor Detail
Instance Method Detail
Adds the capability extension named name, and set it to value. The type of the capability is given by the type of value (either Bool, Int32 or String)
Gets the value of extension name, dispatched on its declared type, or
nil if the extension does not exist (or is a string with no value).
unibi_get_ext_bool_name returns NULL when i is out of range
(>= #count_bool). This returns a non-nil String (used as a
capability-index key), so raise instead of dereferencing NULL.
unibi_get_ext_num_name returns NULL when i is out of range
(>= #count_num). This returns a non-nil String (used as a
capability-index key), so raise instead of dereferencing NULL.
unibi_get_ext_str_name returns NULL when i is out of range
(>= #count_str). This returns a non-nil String (used as a
capability-index key), so raise instead of dereferencing NULL.
The capability-extension index, built lazily on first access.
Building it scans every extended capability and allocates a String per
name, so it's deferred until an extension is actually used.
Sets the value of capability name to value, adding it first if it doesn't exist.