Class: Hegel::Generators::JustGenerator

Inherits:
Hegel::Generator show all
Defined in:
lib/hegel/generators.rb,
sig/hegel.rbs

Overview

Hegel::Syntax::Methods#just. Always returns value, drawing nothing: there is no choice for libhegel to make, so this opens no span (a span exists to let the shrinker retry or isolate a draw, and there is nothing here to retry or isolate).

Instance Method Summary collapse

Methods inherited from Hegel::Generator

#filter, #map

Constructor Details

#initialize(value) ⇒ JustGenerator

Returns a new instance of JustGenerator.

Parameters:

  • value (Object)


195
196
197
198
# File 'lib/hegel/generators.rb', line 195

def initialize(value)
  super()
  @value = value
end

Instance Method Details

#do_draw(_tc) ⇒ Object

Parameters:

  • tc (Object)

Returns:

  • (Object)


200
201
202
# File 'lib/hegel/generators.rb', line 200

def do_draw(_tc)
  @value
end