Class | Qpid::Proton::Codec::Data |
In: |
lib/codec/data.rb
|
Parent: | Object |
@private wrapper for pn_data_t* Raises TypeError for invalid conversions
PROTON_METHOD_PREFIX | = | "pn_data" | @private |
@private Clear a pn_data_t* and convert a ruby object into it. If x==nil leave it empty.
@overload initialize(capacity)
@param capacity [Integer] capacity for the new data instance.
@overload instance(impl)
@param impl [SWIG::pn_data_t*] wrap the C impl pointer.
@private Convert a pn_data_t* containing a single value to a ruby object. @return [Object, nil] The ruby value extracted from impl or nil if impl is empty
If the current node is a boolean, then it returns the value. Otherwise, it returns false.
@return [Boolean] The boolean value.
If the current node is a character, returns its value. Otherwise, returns 0.
@return [Integer] The character value.
If the current node is a decimal128, returns its value. Otherwise, returns 0.
@return [Integer] The decimal128 value.
Decodes the first value from supplied AMQP data and returns the number of bytes consumed.
@param encoded [String] The encoded data.
If the current node is a float, returns its value. Otherwise, returns 0.
@return [Float] The floating point value.
If the current node is an integer, returns its value. Otherwise, returns 0.
@return [Integer] The integer value.
If the current node is an unsigned int, returns its value. Otherwise, returns 0.
@return [Integer] The unsigned integer value.
If the current value is a UUID, returns its value. Otherwise, it returns nil.
@return [String] The string representation of the UUID.
Puts a UUID value.
The UUID is expected to be in the format of a string or else a 128-bit integer value.
@param value [String, Numeric] A string or numeric representation of the UUID.
@example
# set a uuid value from a string value require 'securerandom' @impl.uuid = SecureRandom.uuid # or @impl.uuid = "fd0289a5-8eec-4a08-9283-81d02c9d2fff" # set a uuid value from a 128-bit value @impl.uuid = 0 # sets to 00000000-0000-0000-0000-000000000000