Module: Gitlab::Sentence

Extended by:
Sentence
Included in:
Sentence
Defined in:
lib/gitlab/sentence.rb

Instance Method Summary collapse

Instance Method Details

#to_exclusive_sentence(array) ⇒ Object

Wraps ActiveSupport’s Array#to_sentence to convert the given array to a comma-separated sentence joined with localized ‘or’ Strings instead of ‘and’.



8
9
10
# File 'lib/gitlab/sentence.rb', line 8

def to_exclusive_sentence(array)
  array.to_sentence(two_words_connector: _(' or '), last_word_connector: _(', or '))
end