module Ordinal

Changes since 0.1:

    • require 'File/self.relative_path' from Ordinal/Array and replaced with require_relative.

    • require 'File/self.relative_path' from Ordinal/Array and replaced with require_relative.

Public Instance Methods

all_but_first() click to toggle source
# File lib/Ordinal.rb, line 139
def all_but_first
  entries.drop(1)
end
all_but_first_and_last() click to toggle source
# File lib/Ordinal.rb, line 147
def all_but_first_and_last
  entries.all_but_first.all_but_last
end
all_but_last() click to toggle source
# File lib/Ordinal.rb, line 143
def all_but_last
  entries.take(count - 1)
end
eighteenth() click to toggle source
# File lib/Ordinal.rb, line 86
def eighteenth
  entries[17]
end
eighth() click to toggle source
# File lib/Ordinal.rb, line 46
def eighth
  entries[7]
end
eighth_last() click to toggle source
# File lib/Ordinal.rb, line 106
def eighth_last
  entries[count - 8]
end
eleventh() click to toggle source
# File lib/Ordinal.rb, line 58
def eleventh
  entries[10]
end
fifteenth() click to toggle source
# File lib/Ordinal.rb, line 74
def fifteenth
  entries[14]
end
fifth() click to toggle source
# File lib/Ordinal.rb, line 34
def fifth
  entries[4]
end
fifth_last() click to toggle source
# File lib/Ordinal.rb, line 118
def fifth_last
  entries[count - 5]
end
first() click to toggle source
# File lib/Ordinal.rb, line 18
def first
  entries[0]
end
first_and_last() click to toggle source
# File lib/Ordinal.rb, line 151
def first_and_last
  [entries.first] + [entries.last]
end
first_last()
Alias for: last
fourteenth() click to toggle source
# File lib/Ordinal.rb, line 70
def fourteenth
  entries[13]
end
fourth() click to toggle source
# File lib/Ordinal.rb, line 30
def fourth
  entries[3]
end
fourth_last() click to toggle source
# File lib/Ordinal.rb, line 122
def fourth_last
  entries[count - 4]
end
last() click to toggle source
# File lib/Ordinal.rb, line 134
def last
  entries[count - 1]
end
Also aliased as: first_last
ninteenth() click to toggle source
# File lib/Ordinal.rb, line 90
def ninteenth
  entries[18]
end
ninth() click to toggle source
# File lib/Ordinal.rb, line 50
def ninth
  entries[8]
end
ninth_last() click to toggle source
# File lib/Ordinal.rb, line 102
def ninth_last
  entries[count - 9]
end
second() click to toggle source
# File lib/Ordinal.rb, line 22
def second
  entries[1]
end
second_last() click to toggle source
# File lib/Ordinal.rb, line 130
def second_last
  entries[count - 2]
end
seventeenth() click to toggle source
# File lib/Ordinal.rb, line 82
def seventeenth
  entries[16]
end
seventh() click to toggle source
# File lib/Ordinal.rb, line 42
def seventh
  entries[6]
end
seventh_last() click to toggle source
# File lib/Ordinal.rb, line 110
def seventh_last
  entries[count - 7]
end
sixteenth() click to toggle source
# File lib/Ordinal.rb, line 78
def sixteenth
  entries[15]
end
sixth() click to toggle source
# File lib/Ordinal.rb, line 38
def sixth
  entries[5]
end
sixth_last() click to toggle source
# File lib/Ordinal.rb, line 114
def sixth_last
  entries[count - 6]
end
tenth() click to toggle source
# File lib/Ordinal.rb, line 54
def tenth
  entries[9]
end
tenth_last() click to toggle source
# File lib/Ordinal.rb, line 98
def tenth_last
  entries[count - 10]
end
third() click to toggle source
# File lib/Ordinal.rb, line 26
def third
  entries[2]
end
third_last() click to toggle source
# File lib/Ordinal.rb, line 126
def third_last
  entries[count - 3]
end
thirteenth() click to toggle source
# File lib/Ordinal.rb, line 66
def thirteenth
  entries[12]
end
twelfth() click to toggle source
# File lib/Ordinal.rb, line 62
def twelfth
  entries[11]
end
twentieth() click to toggle source
# File lib/Ordinal.rb, line 94
def twentieth
  entries[19]
end