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(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

#nameObject (readonly)

Returns the value of attribute name.



52
53
54
# File 'lib/bindata/sanitize.rb', line 52

def name
  @name
end

#prototypeObject (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

Returns:

  • (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_symObject



54
55
56
# File 'lib/bindata/sanitize.rb', line 54

def name_as_sym
  @name&.to_sym
end