Class: LIT::Builder::Map Private
- Inherits:
-
Object
- Object
- LIT::Builder::Map
- Defined in:
- lib/lit/builder/map.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #build ⇒ Object private
-
#initialize(mod, key_type, value_type) ⇒ Map
constructor
private
A new instance of Map.
Constructor Details
#initialize(mod, key_type, value_type) ⇒ Map
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Map.
8 9 10 11 12 |
# File 'lib/lit/builder/map.rb', line 8 def initialize(mod, key_type, value_type) @type_checker = TypeChecker.new(mod) @key_type = key_type @value_type = value_type end |
Instance Method Details
#build ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lit/builder/map.rb', line 14 def build type_checker = @type_checker key_type = @key_type value_type = @value_type Class.new(::LIT::Object::Map) do define_method(:check_type!) do |key, value| type_checker.check_type!(key_type, key) type_checker.check_type!(value_type, value) end private(:check_type!) end end |