Class: MooTool::Models::DeviceTree::Property
- Inherits:
-
Object
- Object
- MooTool::Models::DeviceTree::Property
- Defined in:
- lib/mootool/models/device_tree.rb
Overview
Represents a single property and it's value
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data) ⇒ Property
constructor
A new instance of Property.
Constructor Details
#initialize(data) ⇒ Property
Returns a new instance of Property.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/mootool/models/device_tree.rb', line 49 def initialize(data) args = data.read(36).unpack(PROP_FORMAT) @name = args[0] @size = args[1] if @size & 0x80000000 != 0 @template = true @size &= 0x7fffffff end @value = T.must(data.read(@size.align(4)))[0..(@size - 1)] normalize end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
47 48 49 |
# File 'lib/mootool/models/device_tree.rb', line 47 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
47 48 49 |
# File 'lib/mootool/models/device_tree.rb', line 47 def value @value end |