Class: LIT::Builder::Array Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lit/builder/array.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.

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(mod, type) ⇒ Array

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 Array.

Since:

  • 0.1.0



8
9
10
11
# File 'lib/lit/builder/array.rb', line 8

def initialize(mod, type)
  @type_checker = TypeChecker.new(mod)
  @type = type
end

Instance Method Details

#buildObject

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.

Since:

  • 0.1.0



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/lit/builder/array.rb', line 13

def build
  type_checker = @type_checker
  type = @type

  Class.new(::LIT::Object::Array) do
    define_method(:check_type!) do |value|
      type_checker.check_type!(type, value)
    end

    private(:check_type!)
  end
end