class ActionDispatch::Routing::Mapper::Resources::Resource

:nodoc:

def actions

def actions
  if only = @options[:only]
    Array(only).map(&:to_sym)
  elsif except = @options[:except]
    default_actions - Array(except).map(&:to_sym)
  else
    default_actions
  end
end

def collection_name

Checks for uncountable plurals, and appends "_index" if they're.
def collection_name
  singular == plural ? "#{plural}_index" : plural
end

def default_actions

def default_actions
  self.class::DEFAULT_ACTIONS
end

def initialize(entities, options = {})

def initialize(entities, options = {})
  @name       = entities.to_s
  @path       = (options.delete(:path) || @name).to_s
  @controller = (options.delete(:controller) || @name).to_s
  @as         = options.delete(:as)
  @options    = options
end

def member_scope

def member_scope
  "#{path}/:id"
end

def name

def name
  @as || @name
end

def nested_scope

def nested_scope
  "#{path}/:#{singular}_id"
end

def new_scope(new_path)

def new_scope(new_path)
  "#{path}/#{new_path}"
end

def plural

def plural
  @plural ||= name.to_s
end

def resource_scope

def resource_scope
  { :controller => controller }
end

def singular

def singular
  @singular ||= name.to_s.singularize
end