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.



253
254
255
256
257
258
259
260
# File 'lib/bindata/sanitize.rb', line 253

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



262
263
264
# File 'lib/bindata/sanitize.rb', line 262

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