Class: Charty::TableAdapters::BaseAdapter
- Inherits:
-
Object
- Object
- Charty::TableAdapters::BaseAdapter
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/charty/table_adapters/base_adapter.rb
Direct Known Subclasses
ActiveRecordAdapter, DaruAdapter, DatasetsAdapter, HashAdapter, NArrayAdapter, NMatrixAdapter, PandasDataFrameAdapter
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
9 10 11 |
# File 'lib/charty/table_adapters/base_adapter.rb', line 9 def columns @columns end |
#index ⇒ Object
Returns the value of attribute index.
19 20 21 |
# File 'lib/charty/table_adapters/base_adapter.rb', line 19 def index @index end |
Instance Method Details
#==(other) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/charty/table_adapters/base_adapter.rb', line 25 def ==(other) case other when BaseAdapter return false if columns != other.columns return false if index != other.index compare_data_equality(other) else false end end |
#column_names ⇒ Object
15 16 17 |
# File 'lib/charty/table_adapters/base_adapter.rb', line 15 def column_names columns.to_a end |
#compare_data_equality(other) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/charty/table_adapters/base_adapter.rb', line 36 def compare_data_equality(other) columns.each do |name| if self[nil, name] != other[nil, name] return false end end true end |