Class: Forall::Input::All
Overview
Exhaustive list of possible input values
Instance Method Summary
collapse
build, exhaustive, sampled, #shrink
Constructor Details
#initialize(items) ⇒ All
Returns a new instance of All.
59
60
61
62
|
# File 'lib/forall/input.rb', line 59
def initialize(items)
@items = items
@shrink = nil
end
|
Instance Method Details
#each(random, *args) ⇒ Object
72
73
74
|
# File 'lib/forall/input.rb', line 72
def each(random, *args)
@items.each{|input| yield input }
end
|
#exhaustive? ⇒ Boolean
64
65
66
|
# File 'lib/forall/input.rb', line 64
def exhaustive?
true
end
|
#sample(random, count: nil) ⇒ Object
68
69
70
|
# File 'lib/forall/input.rb', line 68
def sample(random, count: nil)
random.sample(@items, count: count)
end
|
#size ⇒ Object
76
77
78
|
# File 'lib/forall/input.rb', line 76
def size
@items.size
end
|