Class: CALazyMarker
- Inherits:
-
Object
- Object
- CALazyMarker
- Defined in:
- lib/carray/lazy.rb
Instance Method Summary collapse
-
#dump_tree(indent = 0) ⇒ String
Returns an ASCII summary of the marker and its parent entity.
-
#each({ |value| ... }) ⇒ Object
Yields each element of the wrapped entity (no materialise needed).
-
#inspect ⇒ String
Returns a short summary showing the wrapped entity.
-
#to_a ⇒ Array
Returns the wrapped entity's Array.
-
#to_memory_view ⇒ Object
Not supported: markers do not own a backing buffer.
-
#to_s ⇒ String
Alias of #inspect.
Instance Method Details
#dump_tree(indent = 0) ⇒ String
750 751 752 753 754 |
# File 'lib/carray/lazy.rb', line 750 def dump_tree(indent = 0) pad = " " * indent "#{pad}lazy(marker)\n" \ "#{" " * (indent + 1)}#{parent.class}(#{parent.data_type_name}, #{parent.shape.inspect})\n" end |
#each({ |value| ... }) ⇒ Object
760 761 762 |
# File 'lib/carray/lazy.rb', line 760 def each(&block) parent.each(&block) end |
#inspect ⇒ String
736 737 738 |
# File 'lib/carray/lazy.rb', line 736 def inspect "#<CALazyMarker over #{parent.inspect}>" end |
#to_memory_view ⇒ Object
774 775 776 777 778 779 |
# File 'lib/carray/lazy.rb', line 774 def to_memory_view raise TypeError, "lazy marker (CALazyMarker) has no backing buffer; call " \ "`.copy` first to materialise into an entity before " \ "exporting via MemoryView." end |
#to_s ⇒ String
743 744 745 |
# File 'lib/carray/lazy.rb', line 743 def to_s inspect end |