Class: Mutant::Meta::Example::DSL Private
- Inherits:
-
Object
- Object
- Mutant::Meta::Example::DSL
- Includes:
- AST::Sexp
- Defined in:
- lib/mutant/meta/example/dsl.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.
Example DSL
Class Method Summary collapse
-
.call(file, types, block) ⇒ Example
private
Run DSL on block.
Instance Method Summary collapse
-
#example ⇒ Example
private
Example captured by DSL.
-
#initialize(file, types) ⇒ undefined
constructor
private
Initialize object.
Constructor Details
#initialize(file, types) ⇒ undefined
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.
Initialize object
27 28 29 30 31 32 |
# File 'lib/mutant/meta/example/dsl.rb', line 27 def initialize(file, types) @file = file @types = types @node = nil @expected = [] end |
Class Method Details
.call(file, types, block) ⇒ Example
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.
Run DSL on block
16 17 18 19 20 |
# File 'lib/mutant/meta/example/dsl.rb', line 16 def self.call(file, types, block) instance = new(file, types) instance.instance_eval(&block) instance.example end |
Instance Method Details
#example ⇒ Example
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.
Example captured by DSL
40 41 42 43 44 45 46 47 48 |
# File 'lib/mutant/meta/example/dsl.rb', line 40 def example fail 'source not defined' unless @node Example.new( file: @file, node: @node, types: @types, expected: @expected ) end |