Contents
- Usage page
-
API docs index
-
Cassandra module
- AddressResolution module
- AttrBoolean module
- Auth module
- Compression module
- CustomData module
- Error module
- Errors module
- Execution module
- LoadBalancing module
- Reconnection module
- Retry module
- Statement module
- Statements module
- TimestampGenerator module
- Types module
- Aggregate class
- Argument class
- Cluster class
- Column class
- ColumnContainer class
- Function class
- Future class
- Host class
- Index class
- Keyspace class
- Listener class
- Logger class
- MaterializedView class
- Result class
- Session class
- Table class
- Time class
- TimeUuid class
- Trigger class
- Tuple class
- Type class
-
UDT class
- Uuid class
-
Cassandra module
A user-defined type value representation
Inherits
Object
Includes
Enumerable
Methods
Creates a UDT instance
- Examples:
-
- Various ways of creating the same UDT instance
Cassandra::UDT.new({'street' => '123 Main St.', 'city' => 'Whatever', 'state' => 'XZ', 'zip' => '10020'}) Cassandra::UDT.new(street: '123 Main St.', city: 'Whatever', state: 'XZ', zip: '10020') Cassandra::UDT.new('street', '123 Main St.', 'city', 'Whatever', 'state', 'XZ', 'zip', '10020') Cassandra::UDT.new(:street, '123 Main St.', :city, 'Whatever', :state, 'XZ', :zip, '10020') Cassandra::UDT.new(['street', '123 Main St.'], ['city', 'Whatever'], ['state', 'XZ'], ['zip', '10020']) Cassandra::UDT.new([:street, '123 Main St.'], [:city, 'Whatever'], [:state, 'XZ'], [:zip, '10020']) Cassandra::UDT.new([['street', '123 Main St.'], ['city', 'Whatever'], ['state', 'XZ'], ['zip', '10020']]) Cassandra::UDT.new([[:street, '123 Main St.'], [:city, 'Whatever'], [:state, 'XZ'], [:zip, '10020']])
- Parameters:
-
Name Type Details values ( Hash
<String
,Object
>,Array
<Array
<String
,Object
>>, *Object
or *Array
<String
,Object
>)- UDT field values
Returns true if a field with a given name is present
- Parameters:
-
Name Type Details field Symbol
method or name of the field - Returns:
-
Type Details Boolean
whether a field is present
Returns value of the field.
- Parameters:
-
Name Type Details field ( String
orInteger
)name or numeric index of the field to lookup - Returns:
-
Type Details Object
value of the field, or nil if the field is not present - Raises:
-
Type Details ArgumentError
when neither a numeric index nor a field name given
Returns value of the field.
- Parameters:
-
Name Type Details field ( String
orInteger
)name or numeric index of the field to lookup - Returns:
-
Type Details Object
value of the field - Raises:
-
Type Details IndexError
when numeric index given is out of bounds KeyError
when field with a given name is not present ArgumentError
when neither a numeric index nor a field name given
Returns whether the field is present in this UDT
- Parameters:
-
Name Type Details field ( String
orInteger
)name or numeric index of the field to lookup - Returns:
-
Type Details Boolean
whether the field is present in this UDT
Sets value of the field.
- Parameters:
-
Name Type Details field String
name of the field to set value Object
new value for the field - Returns:
-
Type Details Object
value. - Raises:
-
Type Details IndexError
when numeric index given is out of bounds KeyError
when field with a given name is not present ArgumentError
when neither a numeric index nor a field name given
Iterates over all fields of the UDT
- Yield Parameters:
-
Name Type Details name String
field name value Object
field value - Returns:
-
Type Details UDT
self