Module: RSpec::JsonApiMatchers::Helpers

Included in:
AttributeMatcher, JsonMatcher
Defined in:
lib/rspec/json_api_matchers/helpers.rb

Instance Method Summary collapse

Instance Method Details

#sentencize(*clauses) ⇒ Object

Returns string composed of the specified clauses with proper spacing between them. Empty and nil clauses are ignored.



5
6
7
8
9
10
11
12
# File 'lib/rspec/json_api_matchers/helpers.rb', line 5

def sentencize(*clauses)
  clauses
    .flatten
    .compact
    .reject(&:empty?)
    .map(&:strip)
    .join(" ")
end