struct Amber::Support::Inflector::SingularRule

Overview

A suffix rule: a word that ends in #suffix (in any case), after a character that #preceding allows, swaps that suffix for #replacement.

Defined in:

amber/support/inflector.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(suffix : String, replacement : String, preceding : Preceding = Preceding::Anything) #

[View source]

Instance Method Detail

def applies_to?(word : String) : Bool #

[View source]
def apply(word : String) : String #

Returns word with its suffix replaced; call it only when #applies_to? holds.


[View source]
def preceding : Preceding #

[View source]
def replacement : String #

[View source]
def suffix : String #

[View source]