Class for nesting a BitStruct as a field within another BitStruct. Declared with BitStruct.nest.
Used in describe.
# File lib/bit-struct/nested-field.rb, line 12 def self.class_name @class_name ||= "nest" end
# File lib/bit-struct/nested-field.rb, line 7 def initialize(*args) super end
# File lib/bit-struct/nested-field.rb, line 16 def class_name @class_name ||= nested_class.name[/\w+$/] end
# File lib/bit-struct/nested-field.rb, line 24 def describe opts if opts[:expand] opts = opts.dup opts[:byte_offset] = offset / 8 opts[:omit_header] = opts[:omit_footer] = true nested_class.describe(nil, opts) {|desc| yield desc} else super end end
# File lib/bit-struct/nested-field.rb, line 20 def nested_class @nested_class ||= options[:nested_class] || options["nested_class"] end