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.



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

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.



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

def prototype
  @prototype
end

Instance Method Details

#has_parameter?(param) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/bindata/sanitize.rb', line 59

def has_parameter?(param)
  @prototype.has_parameter?(param)
end

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



63
64
65
# File 'lib/bindata/sanitize.rb', line 63

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

#nameObject



55
56
57
# File 'lib/bindata/sanitize.rb', line 55

def name
  @name
end

#name_as_symObject



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

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