Class: Rubex::DataType::Int
- Inherits:
-
Object
- Object
- Rubex::DataType::Int
show all
- Includes:
- IntHelpers
- Defined in:
- lib/rubex/data_type/int.rb
Instance Method Summary
collapse
Methods included from IntHelpers
#to_ruby_object
Methods included from Helpers
#==, #base_type, #c_function_ptr?, #char_ptr?, #to_ruby_object
Instance Method Details
#<=>(other) ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/rubex/data_type/int.rb', line 21
def <=>(other)
if other.char? || other.int8? || other.int16?
1
elsif other.int? || other.int32?
0
else -1
end
end
|
#from_ruby_object(arg) ⇒ Object
9
10
11
|
# File 'lib/rubex/data_type/int.rb', line 9
def from_ruby_object(arg)
"NUM2INT(#{arg})"
end
|
13
14
15
|
# File 'lib/rubex/data_type/int.rb', line 13
def int?
true
end
|
17
18
19
|
# File 'lib/rubex/data_type/int.rb', line 17
def p_formatter
'%d'
end
|
#to_s ⇒ Object
5
6
7
|
# File 'lib/rubex/data_type/int.rb', line 5
def to_s
'int'
end
|