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.
120 121 122 |
# File 'lib/charty/vector_adapters.rb', line 120 def index @index end |
Instance Method Details
#[](key) ⇒ Object
122 123 124 125 126 127 128 129 |
# File 'lib/charty/vector_adapters.rb', line 122 def [](key) case key when Charty::Vector where(key) else super(key_to_loc(key)) end end |
#[]=(key, val) ⇒ Object
131 132 133 |
# File 'lib/charty/vector_adapters.rb', line 131 def []=(key, val) super(key_to_loc(key), val) end |