module RSpec::Grape::Entity::Matchers::MatcherHelpers

Public Instance Methods

entity_class_name(entity) click to toggle source
# File lib/rspec_grape_entity/matchers/matcher_helpers.rb, line 8
def entity_class_name(entity)
  entity.try(:name) || entity.class.name
end
exposure_attribute(exposure, name) click to toggle source
# File lib/rspec_grape_entity/matchers/matcher_helpers.rb, line 12
def exposure_attribute(exposure, name)
  exposure.send name
end
exposure_type(type) click to toggle source
# File lib/rspec_grape_entity/matchers/matcher_helpers.rb, line 16
def exposure_type(type)
  type = type.to_s.split("_").map { |w| w[0].upcase + w[1..] }.join
  Object.const_get "Grape::Entity::Exposure::#{type}Exposure"
end