Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/dsl/python/types/array.rb
Instance Method Summary collapse
- #__ ⇒ Object
- #__add__(other) ⇒ Object
- #__getitem__(index) ⇒ Object
- #__len__ ⇒ Object
- #__sizeof__ ⇒ Object
-
#__str__ ⇒ Object
require ‘objspace’ mi_array = [“npython”, “cli”, “version”] puts ObjectSpace.memsize_of(mi_array).
- #append(item) ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#__ ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dsl/python/types/array.rb', line 9 def __ names = %w[ list.__add__( list.__ge__( list.__iter__() list.__reversed__() list.__class__( list.__getattribute__( list.__le__( list.__rmul__( list.__class_getitem__( list.__getitem__( list.__len__() list.__setattr__( list.__contains__( list.__getstate__() list.__lt__( list.__setitem__( list.__delattr__( list.__gt__( list.__mul__( list.__sizeof__() list.__delitem__( list.__hash__( list.__ne__( list.__str__( list.__dir__() list.__iadd__( list.__new__( list.__subclasshook__( list.__doc__( list.__imul__( list.__reduce__() list.__eq__( list.__init__( list.__reduce_ex__() list.__format__( list.__init_subclass__() list.__repr__()] Dsl::Python.puts_in_columns(names.sort) end |
#__add__(other) ⇒ Object
24 |
# File 'lib/dsl/python/types/array.rb', line 24 def __add__(other) = self.concat(other) |
#__getitem__(index) ⇒ Object
25 |
# File 'lib/dsl/python/types/array.rb', line 25 def __getitem__(index) = self.at(index) |
#__len__ ⇒ Object
26 |
# File 'lib/dsl/python/types/array.rb', line 26 def __len__ = self.length |
#__sizeof__ ⇒ Object
27 28 29 30 |
# File 'lib/dsl/python/types/array.rb', line 27 def __sizeof__ = 40 + self.count * 8 # require 'objspace' # mi_array = ["npython", "cli", "version"] # puts ObjectSpace.memsize_of(mi_array) |
#__str__ ⇒ Object
require ‘objspace’ mi_array = [“npython”, “cli”, “version”] puts ObjectSpace.memsize_of(mi_array)
31 |
# File 'lib/dsl/python/types/array.rb', line 31 def __str__ = self.to_s |
#append(item) ⇒ Object
5 6 7 |
# File 'lib/dsl/python/types/array.rb', line 5 def append(item) self.<<(item) end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/dsl/python/types/array.rb', line 33 def to_s inspect end |