Sha256: 07e5d8bb1305033e623166f164942d6516306a610f71a735510ba9f3ce8ea274
Contents?: true
Size: 1.23 KB
Versions: 1
Compression:
Stored size: 1.23 KB
Contents
# frozen_string_literal: true require_relative 'whakahua' # Number in Maori module Tau def whakahua(tau) raise "Class '#{tau.class}' not implmemented" unless tau.is_a? Integer tau.whakahua end # List numbers def self.rarangi { 1 => 'tahi', 2 => 'rua', 3 => 'toru', 4 => 'wha', 5 => 'rima', 6 => 'ono', 7 => 'waru', 8 => 'iwa', 10 => 'tekau' } end def digit(tau, second_digit) return tau if second_digit.nil? ((tau - 1) * 10) + second_digit end # 1 def tahi 1 end # 2 def rua(second_digit = nil) digit(2, second_digit) end # 3 def toru(second_digit = nil) digit(3, second_digit) end # 4 def wha(second_digit = nil) digit(4, second_digit) end # 5 def rima(second_digit = nil) digit(5, second_digit) end # 6 def ono(second_digit = nil) digit(6, second_digit) end def whitu(second_digit = nil) digit(7, second_digit) end def waru(second_digit = nil) digit(8, second_digit) end def iwa(second_digit = nil) digit(9, second_digit) end # 10. Used to add groups of 10 def tekau(extra_digit = nil) extra_digit ? 10 + extra_digit : 10 end # Add extra digit def ma(extra_digit) extra_digit end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
te_reo_maori-0.1.2 | lib/te_reo_maori/tau.rb |