Class: Rubex::DataType::UChar

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/rubex/data_type/u_char.rb

Instance Method Summary collapse

Methods included from Helpers

#==, #base_type, #c_function_ptr?, #char_ptr?, #to_ruby_object

Instance Method Details

#<=>(other) ⇒ Object



22
23
24
# File 'lib/rubex/data_type/u_char.rb', line 22

def <=>(other)
  (other.char? || other.uchar?) ? 0 : 1
end

#from_ruby_object(arg) ⇒ Object



10
11
12
# File 'lib/rubex/data_type/u_char.rb', line 10

def from_ruby_object(arg)
  "(unsigned char)NUM2INT(#{arg})"
end

#p_formatterObject



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

def p_formatter
  '%d'
end

#to_sObject



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

def to_s
  'unsigned char'
end

#uchar?Boolean

Returns:



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

def uchar?
  true
end