Module: RegexpExamples::ForceLazyEnumerators

Included in:
GroupWithIgnoreCase, RandomResultBySample
Defined in:
lib/regexp-examples/groups.rb

Instance Method Summary collapse

Instance Method Details

#force_if_lazy(arr_or_enum) ⇒ Object



25
26
27
# File 'lib/regexp-examples/groups.rb', line 25

def force_if_lazy(arr_or_enum)
  arr_or_enum.respond_to?(:force) ? arr_or_enum.force : arr_or_enum
end