class BitStruct::VectorField
Class for embedding a BitStruct::Vector
as a field within a BitStruct
. Declared with BitStruct.vector
.
Public Class Methods
class_name()
click to toggle source
Used in describe.
# File lib/bit-struct/vector-field.rb 8 def self.class_name 9 @class_name ||= "vector" 10 end
Public Instance Methods
class_name()
click to toggle source
Used in describe.
# File lib/bit-struct/vector-field.rb 13 def class_name 14 @class_name ||= vector_class.name[/\w+$/] 15 end
vector_class()
click to toggle source
Returns the subclass of Vector
that is used to manage the value of this field. If the class was specified in the BitStruct.vector
declaration, vector_class
will return it, otherwise it will be an anonymous class (which you can assign to a constant to make nonymous ;).
# File lib/bit-struct/vector-field.rb 21 def vector_class 22 @vector_class ||= options[:vector_class] || options["vector_class"] 23 end