module RSpecApi::Resource::Actions

Private Instance Methods

description_for(params = {}) click to toggle source
# File lib/rspec-api/resource/actions.rb, line 20
def description_for(params = {})
  action, name, plural = params.values_at(:action, :resource_name, :collection)
  [verb_for(action), object_for(name.to_s, plural)].compact.join ' '
end
object_for(name, plural) click to toggle source
# File lib/rspec-api/resource/actions.rb, line 35
def object_for(name, plural)
  plural ? "a list of #{name.pluralize}" : "one #{name}"
end
verb_for(action) click to toggle source
# File lib/rspec-api/resource/actions.rb, line 25
def verb_for(action)
  case action
    when :get then 'Getting'
    when :put then 'Editing'
    when :patch then 'Editing'
    when :post then 'Creating'
    when :delete then 'Deleting'
  end
end