Class: BinData::SanitizedField
- Inherits:
-
SanitizedParameter
- Object
- SanitizedParameter
- BinData::SanitizedField
- Defined in:
- lib/bindata/sanitize.rb
Overview
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prototype ⇒ Object
readonly
Returns the value of attribute prototype.
Instance Method Summary collapse
- #has_parameter?(param) ⇒ Boolean
-
#initialize(name, field_type, field_params, hints) ⇒ SanitizedField
constructor
A new instance of SanitizedField.
- #instantiate(value = nil, parent = nil) ⇒ Object
- #name_as_sym ⇒ Object
Constructor Details
#initialize(name, field_type, field_params, hints) ⇒ SanitizedField
Returns a new instance of SanitizedField.
47 48 49 50 |
# File 'lib/bindata/sanitize.rb', line 47 def initialize(name, field_type, field_params, hints) @name = name @prototype = SanitizedPrototype.new(field_type, field_params, hints) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
52 53 54 |
# File 'lib/bindata/sanitize.rb', line 52 def name @name end |
#prototype ⇒ Object (readonly)
Returns the value of attribute prototype.
52 53 54 |
# File 'lib/bindata/sanitize.rb', line 52 def prototype @prototype end |
Instance Method Details
#has_parameter?(param) ⇒ Boolean
58 59 60 |
# File 'lib/bindata/sanitize.rb', line 58 def has_parameter?(param) @prototype.has_parameter?(param) end |
#instantiate(value = nil, parent = nil) ⇒ Object
62 63 64 |
# File 'lib/bindata/sanitize.rb', line 62 def instantiate(value = nil, parent = nil) @prototype.instantiate(value, parent) end |
#name_as_sym ⇒ Object
54 55 56 |
# File 'lib/bindata/sanitize.rb', line 54 def name_as_sym @name&.to_sym end |