Sha256: 1114880604732988c78dde8690a1155b694a7652f71c15755afa329349949ee9
Contents?: true
Size: 509 Bytes
Versions: 24
Compression:
Stored size: 509 Bytes
Contents
require 'treetop' module Merb module Global module Plural path = (Pathname.new(__FILE__).dirname.expand_path + 'plural') @parser = Treetop.load(path.to_s).new # Returns which form should be returned # ==== Parameters # n<Fixnum>:: A number of elements # plural<String>:: Expression # ==== Returns # Fixnum:: Which form should be translated def self.which_form(n, plural) @parser.parse(plural).to_lambda.call(n) end end end end
Version data entries
24 entries across 24 versions & 3 rubygems