Module: Charty::VectorAdapters::IndexSupport

Included in:
ArrayAdapter, ArrowAdapter, NArrayAdapter, NMatrixAdapter, NumpyAdapter, VectorAdapter
Defined in:
lib/charty/vector_adapters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indexObject

Returns the value of attribute index.


144
145
146
# File 'lib/charty/vector_adapters.rb', line 144

def index
  @index
end

Instance Method Details

#[](key) ⇒ Object


146
147
148
149
150
151
152
153
# File 'lib/charty/vector_adapters.rb', line 146

def [](key)
  case key
  when Charty::Vector
    where(key)
  else
    super(key_to_loc(key))
  end
end

#[]=(key, val) ⇒ Object


155
156
157
# File 'lib/charty/vector_adapters.rb', line 155

def []=(key, val)
  super(key_to_loc(key), val)
end