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
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, #new_scope, #resource_scope
Constructor Details
#initialize(entities, options) ⇒ SingletonResource
Returns a new instance of SingletonResource.
933 934 935 936 937 938 |
# File 'lib/action_dispatch/routing/mapper.rb', line 933 def initialize(entities, ) super @as = nil @controller = ([:controller] || plural).to_s @as = [:as] end |
Instance Method Details
#default_actions ⇒ Object
940 941 942 |
# File 'lib/action_dispatch/routing/mapper.rb', line 940 def default_actions [:show, :create, :update, :destroy, :new, :edit] end |
#plural ⇒ Object
944 945 946 |
# File 'lib/action_dispatch/routing/mapper.rb', line 944 def plural @plural ||= name.to_s.pluralize end |
#singular ⇒ Object Also known as: member_name, collection_name
948 949 950 |
# File 'lib/action_dispatch/routing/mapper.rb', line 948 def singular @singular ||= name.to_s end |