lib/bindata/record.rb in bindata-1.8.3 vs lib/bindata/record.rb in bindata-2.0.0
- old
+ new
@@ -1,11 +1,29 @@
require 'bindata/dsl'
+require 'bindata/sanitize'
require 'bindata/struct'
module BinData
# A Record is a declarative wrapper around Struct.
#
- # See +Struct+ for more info.
+ # require 'bindata'
+ #
+ # class SomeDataType < BinData::Record
+ # hide :a
+ #
+ # int32le :a
+ # int16le :b
+ # struct :s do
+ # int8 :x
+ # int8 :y
+ # int8 :z
+ # end
+ # end
+ #
+ # obj = SomeDataType.new
+ # obj.field_names =># [:b, :s]
+ # obj.s.field_names =># [:x, :y, :z]
+ #
class Record < BinData::Struct
include DSLMixin
unregister_self
dsl_parser :struct