module Vidibus::Permalink::Mongoid

Public Instance Methods

Private Instance Methods

get_scope() click to toggle source
# File lib/vidibus/permalink/mongoid.rb, line 98
def get_scope
  scope = self.class.permalink_options[:scope]
  return unless scope
  {}.tap do |hash|
    scope.each do |key, value|
      if value.kind_of?(String)
        hash[key] = value
      elsif value.kind_of?(Symbol) && respond_to?(value)
        hash[key] = send(value)
      else
        raise PermalinkConfigurationError.new(
          %Q{No scope value for key "#{key}" found.}
        )
      end
    end
  end
end