class NTable::EmptyAxis

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.

Public Instance Methods

==(obj_) click to toggle source
Alias for: eql?
eql?(obj_) click to toggle source

Axis objects must implement an equality check.

# File lib/ntable/axis.rb, line 54
def eql?(obj_)
  obj_.is_a?(EmptyAxis)
end
Also aliased as: ==
from_json_object(json_obj_) click to toggle source

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
hash() click to toggle source

Axis objects must implement a hash

# File lib/ntable/axis.rb, line 62
def hash
  self.class.hash
end
index(label_) click to toggle source

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
inspect() click to toggle source

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
Also aliased as: to_s
label(index_) click to toggle source

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
size() click to toggle source

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
to_json_object(json_obj_) click to toggle source

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
to_s() click to toggle source
Alias for: inspect