Provides a label for an object. This simple implementation calls to_s on the given object, and handles articles ‘a/an/the’.
Produces a label for the given text with indefinite article (a/an)
# File lib/puppet/pops/label_provider.rb, line 17 def a_an o text = label(o) "#{article(text)} #{text}" end
Produces a label for the given text with indefinite article (A/An)
# File lib/puppet/pops/label_provider.rb, line 23 def a_an_uc o text = label(o) "#{article(text).capitalize} #{text}" end
Provides a label for the given object by calling `to_s` on the object. The intent is for this method to be overridden in concrete label providers.
# File lib/puppet/pops/label_provider.rb, line 12 def label o o.to_s end
Appends ‘s’ to (optional) text if count != 1 else an empty string
# File lib/puppet/pops/label_provider.rb, line 39 def plural_s(count, text = '') count == 1 ? text : "#{text}s" end
Produces a label for the given text with *definitie article* (the).
# File lib/puppet/pops/label_provider.rb, line 29 def the o "the #{label(o)}" end
Produces a label for the given text with *definitie article* (The).
# File lib/puppet/pops/label_provider.rb, line 34 def the_uc o "The #{label(o)}" end