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.



146
147
148
# File 'lib/charty/vector_adapters.rb', line 146

def index
  @index
end

Instance Method Details

#[](key) ⇒ Object



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

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

#[]=(key, val) ⇒ Object



157
158
159
# File 'lib/charty/vector_adapters.rb', line 157

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