Class: Literal::Types::IntegerType

Inherits:
Object
  • Object
show all
Defined in:
lib/literal/types/integer_type.rb

Instance Method Summary collapse

Constructor Details

#initialize(range) ⇒ IntegerType

Returns a new instance of IntegerType.



2
3
4
# File 'lib/literal/types/integer_type.rb', line 2

def initialize(range)
  @range = range
end

Instance Method Details

#===(other) ⇒ Object



10
11
12
# File 'lib/literal/types/integer_type.rb', line 10

def ===(other)
  other.is_a?(::Integer) && @range === other
end

#inspectObject



6
7
8
# File 'lib/literal/types/integer_type.rb', line 6

def inspect
  "Integer(#{@range})"
end