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
- #has_parameter?(param) ⇒ Boolean
-
#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.
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
#prototype ⇒ Object (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
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 |
#name ⇒ Object
55 56 57 |
# File 'lib/bindata/sanitize.rb', line 55 def name @name end |
#name_as_sym ⇒ Object
51 52 53 |
# File 'lib/bindata/sanitize.rb', line 51 def name_as_sym @name.nil? ? nil : @name.to_sym end |