Module: Revector::Startify

Defined in:
lib/revector/predicate/startify.rb

Class Method Summary collapse

Class Method Details

.check!(item, iteratee, right) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/revector/predicate/startify.rb', line 5

def self.check!(item, iteratee, right)
  left = Utility::TryFetchOrBlank[item, iteratee]
  return false unless left

  regex = /^#{right}/
  left.to_s.match?(regex)
end

.compare(left, right) ⇒ Object



13
14
15
16
# File 'lib/revector/predicate/startify.rb', line 13

def self.compare(left, right)
  regex = /^#{right}/
  left.to_s.match?(regex)
end