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

:nodoc:

def actions

def actions
  if @except
    available_actions - Array(@except).map(&:to_sym)
  else
    available_actions
  end
end

def available_actions

def available_actions
  if @only
    Array(@only).map(&:to_sym)
  else
    default_actions
  end
end

def collection_name

and singular form are the same.
Checks for uncountable plurals, and appends "_index" if the plural
def collection_name
  singular == plural ? "#{plural}_index" : plural
end

def default_actions

def default_actions
  if @api_only
    [:index, :create, :show, :update, :destroy]
  else
    [:index, :create, :new, :show, :update, :destroy, :edit]
  end
end

def initialize(entities, api_only, shallow, options = {})

def initialize(entities, api_only, shallow, options = {})
  if options[:param].to_s.include?(":")
    raise ArgumentError, ":param option can't contain colons"
  end
  @name       = entities.to_s
  @path       = (options[:path] || @name).to_s
  @controller = (options[:controller] || @name).to_s
  @as         = options[:as]
  @param      = (options[:param] || :id).to_sym
  @options    = options
  @shallow    = shallow
  @api_only   = api_only
  @only       = options.delete :only
  @except     = options.delete :except
end

def member_scope

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

def name

def name
  @as || @name
end

def nested_param

def nested_param
  :"#{singular}_#{param}"
end

def nested_scope

def nested_scope
  "#{path}/:#{nested_param}"
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
end

def shallow?

def shallow?
  @shallow
end

def singleton?; false; end

def singleton?; false; end

def singular

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