Class: BinData::SanitizedPrototype

Inherits:
SanitizedParameter show all
Defined in:
lib/bindata/sanitize.rb

Instance Method Summary collapse

Constructor Details

#initialize(sanitizer, obj_type, obj_params, endian = nil) ⇒ SanitizedPrototype

Returns a new instance of SanitizedPrototype.



193
194
195
196
197
198
# File 'lib/bindata/sanitize.rb', line 193

def initialize(sanitizer, obj_type, obj_params, endian = nil)
  sanitizer.with_endian(endian) do
    @obj_class = sanitizer.lookup_class(obj_type)
    @obj_params = sanitizer.create_sanitized_params(obj_params, @obj_class)
  end
end

Instance Method Details

#instantiate(parent = nil) ⇒ Object



200
201
202
# File 'lib/bindata/sanitize.rb', line 200

def instantiate(parent = nil)
  @obj_class.new(@obj_params, parent)
end