Class: Rubex::DataType::Int8

Inherits:
Object
  • Object
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

#int8?Boolean

Returns:



14
15
16
# File 'lib/rubex/data_type/int_8.rb', line 14

def int8?
  true
end

#p_formatterObject



18
19
20
# File 'lib/rubex/data_type/int_8.rb', line 18

def p_formatter
  '%d'
end

#to_sObject



6
7
8
# File 'lib/rubex/data_type/int_8.rb', line 6

def to_s
  'int8_t'
end