Class: Rubex::DataType::CArray
- Inherits:
-
Object
- Object
- Rubex::DataType::CArray
- Includes:
- Helpers
- Defined in:
- lib/rubex/data_type.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.
464 465 466 |
# File 'lib/rubex/data_type.rb', line 464 def initialize dimension, type @dimension, @type = dimension, type end |
Instance Attribute Details
#dimension ⇒ Object (readonly)
Dimension of the array
460 461 462 |
# File 'lib/rubex/data_type.rb', line 460 def dimension @dimension end |
#type ⇒ Object (readonly)
Type of elements stored in array
462 463 464 |
# File 'lib/rubex/data_type.rb', line 462 def type @type end |
Instance Method Details
#<=>(other) ⇒ Object
470 471 472 473 474 475 476 |
# File 'lib/rubex/data_type.rb', line 470 def <=> other if self.class == other.class @type <=> other.type else @type <=> other end end |
#base_type ⇒ Object
478 479 480 |
# File 'lib/rubex/data_type.rb', line 478 def base_type @type end |