Module: BooleanStringImpl

Included in:
String
Defined in:
lib/sorbet-rails/custom_types/boolean_string.rb

Overview

typed: false

Instance Method Summary collapse

Instance Method Details

#_is_a_boolean_string?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/sorbet-rails/custom_types/boolean_string.rb', line 18

def _is_a_boolean_string?
  return @cached_is_a unless @cached_is_a.nil?
  @cached_is_a = (self =~ /^(true|false)$/i) == 0
end

#instance_of?(type) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/sorbet-rails/custom_types/boolean_string.rb', line 13

def instance_of?(type)
  return super unless type == BooleanString
  _is_a_boolean_string?
end

#is_a?(type) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
# File 'lib/sorbet-rails/custom_types/boolean_string.rb', line 3

def is_a?(type)
  return super unless type == BooleanString
  _is_a_boolean_string?
end

#kind_of?(type) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/sorbet-rails/custom_types/boolean_string.rb', line 8

def kind_of?(type)
  return super unless type == BooleanString
  _is_a_boolean_string?
end