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(sanitizer, name, field_type, field_params) ⇒ SanitizedField

Returns a new instance of SanitizedField.



207
208
209
210
# File 'lib/bindata/sanitize.rb', line 207

def initialize(sanitizer, name, field_type, field_params)
  @name = name.to_s
  @prototype = sanitizer.create_sanitized_object_prototype(field_type, field_params)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



211
212
213
# File 'lib/bindata/sanitize.rb', line 211

def name
  @name
end

Instance Method Details

#instantiate(parent = nil) ⇒ Object



213
214
215
# File 'lib/bindata/sanitize.rb', line 213

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