Module: Charty::VectorAdapters::IndexSupport
- Included in:
- ArrayAdapter, NArrayAdapter, NMatrixAdapter, NumpyAdapter
- Defined in:
- lib/charty/vector_adapters.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
124 125 126 |
# File 'lib/charty/vector_adapters.rb', line 124 def index @index end |
Instance Method Details
#[](key) ⇒ Object
126 127 128 129 130 131 132 133 |
# File 'lib/charty/vector_adapters.rb', line 126 def [](key) case key when Charty::Vector where(key) else super(key_to_loc(key)) end end |
#[]=(key, val) ⇒ Object
135 136 137 |
# File 'lib/charty/vector_adapters.rb', line 135 def []=(key, val) super(key_to_loc(key), val) end |