This is a “null” axis that has no elements. Not terribly useful by itself, but may be a reasonable base class. Accordingly, we will use this class to document the methods required for an axis object.
In general, an axis describes a particular dimension in the table: how large the table is in that dimension, and how the ordered “rows” along that dimension are named.
Axis objects must implement an equality check.
# File lib/ntable/axis.rb, line 54 def eql?(obj_) obj_.is_a?(EmptyAxis) end
Configure this axis given a hash configuration that came from a JSON serialization.
# File lib/ntable/axis.rb, line 110 def from_json_object(json_obj_) end
Axis objects must implement a hash
# File lib/ntable/axis.rb, line 62 def hash self.class.hash end
Given a label object, return the corresponding 0-based integer index. Returns nil if the label is not recognized.
# File lib/ntable/axis.rb, line 86 def index(label_) nil end
Axis methods should implement display methods for debugging.
# File lib/ntable/axis.rb, line 69 def inspect "#<#{self.class}:0x#{object_id.to_s(16)}>" end
Given a 0-based integer index, return the corresponding label object. Returns nil if the index is out of bounds (i.e. is less than 0 or greater than or equal to size.)
# File lib/ntable/axis.rb, line 95 def label(index_) nil end
Return the number of rows along this axis. An empty axis will return 0.
# File lib/ntable/axis.rb, line 78 def size 0 end
Populate the given hash with the configuration of this axis. The hash will eventually be serialized via JSON.
# File lib/ntable/axis.rb, line 103 def to_json_object(json_obj_) end