Class: Rubex::DataType::CArray
- Inherits:
-
Object
- Object
- Rubex::DataType::CArray
- Includes:
- Helpers
- Defined in:
- lib/rubex/data_type/c_array.rb
Instance Attribute Summary collapse
-
#dimension ⇒ Object
readonly
Dimension of the array.
-
#type ⇒ Object
readonly
Type of elements stored in array.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #base_type ⇒ Object
- #carray? ⇒ Boolean
-
#initialize(dimension, type) ⇒ CArray
constructor
A new instance of CArray.
Methods included from Helpers
#==, #c_function_ptr?, #char_ptr?, #from_ruby_object, #to_ruby_object
Constructor Details
#initialize(dimension, type) ⇒ CArray
Returns a new instance of CArray.
10 11 12 13 |
# File 'lib/rubex/data_type/c_array.rb', line 10 def initialize(dimension, type) @dimension = dimension @type = type end |
Instance Attribute Details
#dimension ⇒ Object (readonly)
Dimension of the array
6 7 8 |
# File 'lib/rubex/data_type/c_array.rb', line 6 def dimension @dimension end |
#type ⇒ Object (readonly)
Type of elements stored in array
8 9 10 |
# File 'lib/rubex/data_type/c_array.rb', line 8 def type @type end |
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/rubex/data_type/c_array.rb', line 19 def <=>(other) @type <=> if self.class == other.class other.type else other end end |
#base_type ⇒ Object
28 29 30 |
# File 'lib/rubex/data_type/c_array.rb', line 28 def base_type @type end |