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, hints) ⇒ 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, 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
#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
62 63 64 |
# File 'lib/bindata/sanitize.rb', line 62 def has_parameter?(param) @prototype.has_parameter?(param) end |
#instantiate(value = nil, parent = nil) ⇒ Object
66 67 68 |
# File 'lib/bindata/sanitize.rb', line 66 def instantiate(value = nil, parent = nil) @prototype.instantiate(value, parent) end |
#name ⇒ Object
58 59 60 |
# File 'lib/bindata/sanitize.rb', line 58 def name @name end |
#name_as_sym ⇒ Object
54 55 56 |
# File 'lib/bindata/sanitize.rb', line 54 def name_as_sym @name.nil? ? nil : @name.to_sym end |