module EitherResultMatcher
Constants
- VERSION
Public Class Methods
for(*match_methods)
click to toggle source
Calls superclass method
# File lib/either_result_matcher.rb, line 8 def self.for(*match_methods) matchers_mod = Module.new do match_methods.each do |match_method| define_method(match_method) do |*args, &block| result = super(*args) if block MatchEitherResult(result, &block) else result end end end end Module.new do const_set :Matchers, matchers_mod def self.included(klass) klass.prepend const_get(:Matchers) end end end
included(klass)
click to toggle source
# File lib/either_result_matcher.rb, line 26 def self.included(klass) klass.prepend const_get(:Matchers) end