Class: BinData::SanitizedField
- Inherits:
-
SanitizedParameter
- Object
- SanitizedParameter
- BinData::SanitizedField
- Defined in:
- lib/bindata/sanitize.rb
Overview
Instance Attribute Summary collapse
-
#prototype ⇒ Object
readonly
Returns the value of attribute prototype.
Instance Method Summary collapse
-
#initialize(name, field_type, field_params, endian) ⇒ SanitizedField
constructor
A new instance of SanitizedField.
- #instantiate(value = nil, parent = nil) ⇒ Object
- #name ⇒ Object
- #name_as_sym ⇒ Object
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
#prototype ⇒ Object (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 |
#name ⇒ Object
46 47 48 |
# File 'lib/bindata/sanitize.rb', line 46 def name @name end |
#name_as_sym ⇒ Object
42 43 44 |
# File 'lib/bindata/sanitize.rb', line 42 def name_as_sym @name.nil? ? nil : @name.to_sym end |