Module: IntegerStringImpl

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

Overview

typed: false

Instance Method Summary collapse

Instance Method Details

#_is_a_integer_string?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
# File 'lib/sorbet-rails/custom_types/integer_string.rb', line 18

def _is_a_integer_string?
  return @cached_is_a unless @cached_is_a.nil?
  Integer(self, 10)
  @cached_is_a = true
rescue ArgumentError => err
  @cached_is_a = false
end

#instance_of?(type) ⇒ Boolean

Returns:

  • (Boolean)


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

def instance_of?(type)
  return super unless type == IntegerString
  _is_a_integer_string?
end

#is_a?(type) ⇒ Boolean

Returns:

  • (Boolean)


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

def is_a?(type)
  return super unless type == IntegerString
  _is_a_integer_string?
end

#kind_of?(type) ⇒ Boolean

Returns:

  • (Boolean)


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

def kind_of?(type)
  return super unless type == IntegerString
  _is_a_integer_string?
end