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(name, field_type, field_params, endian) ⇒ SanitizedField

Returns a new instance of SanitizedField.



36
37
38
39
# File 'lib/bindata/sanitize.rb', line 36

def initialize(name, field_type, field_params, endian)
  @name      = name
  @prototype = SanitizedPrototype.new(field_type, field_params, endian)
end

Instance Attribute Details

#prototypeObject (readonly)

Returns the value of attribute prototype.



41
42
43
# File 'lib/bindata/sanitize.rb', line 41

def prototype
  @prototype
end

Instance Method Details

#instantiate(value = nil, parent = nil) ⇒ Object



51
52
53
# File 'lib/bindata/sanitize.rb', line 51

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

#nameObject



47
48
49
# File 'lib/bindata/sanitize.rb', line 47

def name
  @name
end

#name_as_symObject



43
44
45
# File 'lib/bindata/sanitize.rb', line 43

def name_as_sym
  @name.nil? ? nil : @name.to_sym
end