Class: BinData::SanitizedChoices

Inherits:
SanitizedParameter show all
Defined in:
lib/bindata/sanitize.rb

Overview


Instance Method Summary collapse

Constructor Details

#initialize(sanitizer, choices) ⇒ SanitizedChoices

Returns a new instance of SanitizedChoices.



271
272
273
274
275
276
277
278
# File 'lib/bindata/sanitize.rb', line 271

def initialize(sanitizer, choices)
  @choices = {}
  choices.each_pair do |key, val|
    type, param = val
    prototype = sanitizer.create_sanitized_object_prototype(type, param)
    @choices[key] = prototype
  end
end

Instance Method Details

#[](key) ⇒ Object



280
281
282
# File 'lib/bindata/sanitize.rb', line 280

def [](key)
  @choices[key]
end