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, line 8
def self.class_name
  @class_name ||= "vector"
end

Public Instance Methods

class_name() click to toggle source

Used in describe.

# File lib/bit-struct/vector-field.rb, line 13
def class_name
  @class_name ||= vector_class.name[/\w+$/]
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, line 21
def vector_class
  @vector_class ||= options[:vector_class] || options["vector_class"]
end