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.



243
244
245
246
247
248
249
250
# File 'lib/bindata/sanitize.rb', line 243

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



252
253
254
# File 'lib/bindata/sanitize.rb', line 252

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