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, type, block) ⇒ Example
private
Run DSL on block.
Instance Method Summary collapse
-
#example ⇒ Example
private
Example captured by DSL.
-
#initialize(file, type) ⇒ undefined
constructor
private
Initialize object.
Constructor Details
#initialize(file, type) ⇒ 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
24 25 26 27 28 29 |
# File 'lib/mutant/meta/example/dsl.rb', line 24 def initialize(file, type) @file = file @type = type @node = nil @expected = [] end |
Class Method Details
.call(file, type, 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
13 14 15 16 17 |
# File 'lib/mutant/meta/example/dsl.rb', line 13 def self.call(file, type, block) instance = new(file, type) 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
37 38 39 40 41 42 43 44 45 |
# File 'lib/mutant/meta/example/dsl.rb', line 37 def example fail 'source not defined' unless @node Example.new( file: @file, node: @node, node_type: @type, expected: @expected ) end |