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.



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

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.



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

def prototype
  @prototype
end

Instance Method Details

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



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

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

#nameObject



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

def name
  @name
end

#name_as_symObject



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

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