Class: GVariantStringType
- Inherits:
-
GVariantBasicType
- Object
- GVariantBasicType
- GVariantStringType
- Defined in:
- lib/gvariant.rb
Instance Attribute Summary
Attributes inherited from GVariantBasicType
#alignment, #default_value, #fixed_size, #id
Instance Method Summary collapse
-
#initialize(id) ⇒ GVariantStringType
constructor
A new instance of GVariantStringType.
- #read(buf) ⇒ Object
Methods inherited from GVariantBasicType
Constructor Details
#initialize(id) ⇒ GVariantStringType
Returns a new instance of GVariantStringType.
94 95 96 |
# File 'lib/gvariant.rb', line 94 def initialize(id) super(id, 'Z*', 1, nil, '') end |
Instance Method Details
#read(buf) ⇒ Object
98 99 100 101 |
# File 'lib/gvariant.rb', line 98 def read(buf) return @default_value if (buf.length == 0 || buf[buf.length - 1] != "\x00") buf.unpack("Z*").first end |