Class: Rubex::DataType::Int8
- Inherits:
-
Object
- Object
- Rubex::DataType::Int8
show all
- Includes:
- IntHelpers
- Defined in:
- lib/rubex/data_type/int_8.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
22
23
24
25
26
27
28
29
30
|
# File 'lib/rubex/data_type/int_8.rb', line 22
def <=>(other)
if other.char?
1
elsif other.int8?
0
else
-1
end
end
|
#from_ruby_object(arg) ⇒ Object
10
11
12
|
# File 'lib/rubex/data_type/int_8.rb', line 10
def from_ruby_object(arg)
"(int8_t)NUM2INT(#{arg})"
end
|
14
15
16
|
# File 'lib/rubex/data_type/int_8.rb', line 14
def int8?
true
end
|
18
19
20
|
# File 'lib/rubex/data_type/int_8.rb', line 18
def p_formatter
'%d'
end
|
#to_s ⇒ Object
6
7
8
|
# File 'lib/rubex/data_type/int_8.rb', line 6
def to_s
'int8_t'
end
|