Class: BinData::SanitizedField

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

Overview


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sanitizer, name, field_type, field_params, endian) ⇒ SanitizedField

Returns a new instance of SanitizedField.



225
226
227
228
# File 'lib/bindata/sanitize.rb', line 225

def initialize(sanitizer, name, field_type, field_params, endian)
  @name = (name != nil and name != "") ? name.to_s : nil
  @prototype = sanitizer.create_sanitized_object_prototype(field_type, field_params, endian)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



229
230
231
# File 'lib/bindata/sanitize.rb', line 229

def name
  @name
end

Instance Method Details

#instantiate(parent = nil) ⇒ Object



231
232
233
# File 'lib/bindata/sanitize.rb', line 231

def instantiate(parent = nil)
  @prototype.instantiate(parent)
end