Class: LIT::Builder::Option Private
- Inherits:
-
Object
- Object
- LIT::Builder::Option
- Defined in:
- lib/lit/builder/option.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, type) ⇒ Option
constructor
private
A new instance of Option.
Constructor Details
#initialize(mod, type) ⇒ Option
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 Option.
8 9 10 11 |
# File 'lib/lit/builder/option.rb', line 8 def initialize(mod, type) @type_checker = TypeChecker.new(mod) @type = 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.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lit/builder/option.rb', line 13 def build mod = Module.new do include ::LIT::Object::Option end type_checker = @type_checker type = @type mod::Some.define_method(:check_type!) do |value| # NOTE: actually covered, but SimpleCov cannot detect that # :nocov: type_checker.check_type!(type, value) # :nocov: end mod end |