Class: ActionDispatch::Routing::Mapper::Resources::SingletonResource
- Inherits:
-
Resource
- Object
- Resource
- ActionDispatch::Routing::Mapper::Resources::SingletonResource
- Defined in:
- lib/action_dispatch/routing/mapper.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Resource
#controller, #options, #param, #path
Instance Method Summary collapse
- #default_actions ⇒ Object
-
#initialize(entities, options) ⇒ SingletonResource
constructor
A new instance of SingletonResource.
- #plural ⇒ Object
- #singular ⇒ Object (also: #member_name, #collection_name)
Methods inherited from Resource
#actions, #name, #nested_param, #new_scope, #resource_scope, #shallow=, #shallow?
Constructor Details
#initialize(entities, options) ⇒ SingletonResource
Returns a new instance of SingletonResource.
1140 1141 1142 1143 1144 1145 |
# File 'lib/action_dispatch/routing/mapper.rb', line 1140 def initialize(entities, ) super @as = nil @controller = ([:controller] || plural).to_s @as = [:as] end |
Instance Method Details
#default_actions ⇒ Object
1147 1148 1149 |
# File 'lib/action_dispatch/routing/mapper.rb', line 1147 def default_actions [:show, :create, :update, :destroy, :new, :edit] end |
#plural ⇒ Object
1151 1152 1153 |
# File 'lib/action_dispatch/routing/mapper.rb', line 1151 def plural @plural ||= name.to_s.pluralize end |
#singular ⇒ Object Also known as: member_name, collection_name
1155 1156 1157 |
# File 'lib/action_dispatch/routing/mapper.rb', line 1155 def singular @singular ||= name.to_s end |