Class: DBus::Data::Fixed
Overview
A value that has a fixed size (unlike StringLike).
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
- .fixed? ⇒ Boolean
-
.from_raw(value, mode:) ⇒ Object
most Fixed types are valid whatever bits from the wire are used to initialize them.
Instance Method Summary collapse
Methods inherited from Basic
basic?, from_typed, type, #type
Methods inherited from Base
#==, assert_type_matches_class, basic?, #eql?, from_typed, #initialize, #type, type_code
Constructor Details
This class inherits a constructor from DBus::Data::Base
Class Method Details
.from_raw(value, mode:) ⇒ Object
most Fixed types are valid whatever bits from the wire are used to initialize them
148 149 150 151 152 |
# File 'lib/dbus/data.rb', line 148 def self.from_raw(value, mode:) return value if mode == :plain new(value) end |
Instance Method Details
#marshall(endianness) ⇒ Object
155 156 157 |
# File 'lib/dbus/data.rb', line 155 def marshall(endianness) [value].pack(self.class.format[endianness]) end |