Class: Xpect::Every

Inherits:
Object
  • Object
show all
Defined in:
lib/xpect/every.rb

Overview

TODO: Add tests

Instance Method Summary collapse

Constructor Details

#initialize(item_spec) ⇒ Every

Returns a new instance of Every.



4
5
6
# File 'lib/xpect/every.rb', line 4

def initialize(item_spec)
  @item_spec = item_spec
end

Instance Method Details

#conform!(data:, path: []) ⇒ Object



8
9
10
11
12
# File 'lib/xpect/every.rb', line 8

def conform!(data:, path: [])
  data.map do |val|
    Xpect::Type.process(@item_spec, @item_spec, val, path)
  end
end