Module: Trith::Core::Textual::Predicates

Defined in:
lib/trith/core/textual.rb

Overview

Textual predicates.

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) chrp(obj) Also known as: chr?

Parameters:

  • (Object) obj

Returns:



13
14
15
16
17
18
# File 'lib/trith/core/textual.rb', line 13

def chrp(obj)
  case obj
    when String then obj.size == 1
    else false
  end
end

- (Boolean) textp(obj) Also known as: text?

Parameters:

  • (Object) obj

Returns:



24
25
26
27
28
29
# File 'lib/trith/core/textual.rb', line 24

def textp(obj)
  case obj
    when String then true
    else false
  end
end