Class: Objectify::Rails::Routing::ObjectifyMapper
- Inherits:
-
Object
- Object
- Objectify::Rails::Routing::ObjectifyMapper
- Defined in:
- lib/objectify/rails/routing.rb
Instance Method Summary collapse
- #defaults(options) ⇒ Object
- #implementations(options) ⇒ Object
-
#initialize(rails_mapper, application = ::Rails.application, action_factory = Config::Action) ⇒ ObjectifyMapper
constructor
A new instance of ObjectifyMapper.
- #legacy_action(controller, actions, options) ⇒ Object
- #policy_responders(options) ⇒ Object
- #resolvers(options) ⇒ Object
- #resources(*args) ⇒ Object
- #values(options) ⇒ Object
Constructor Details
#initialize(rails_mapper, application = ::Rails.application, action_factory = Config::Action) ⇒ ObjectifyMapper
Returns a new instance of ObjectifyMapper.
12 13 14 15 16 17 18 |
# File 'lib/objectify/rails/routing.rb', line 12 def initialize(rails_mapper, application = ::Rails.application, action_factory = Config::Action) @rails_mapper = rails_mapper @application = application @action_factory = action_factory end |
Instance Method Details
#defaults(options) ⇒ Object
33 34 35 |
# File 'lib/objectify/rails/routing.rb', line 33 def defaults() @application.objectify.append_defaults() end |
#implementations(options) ⇒ Object
41 42 43 |
# File 'lib/objectify/rails/routing.rb', line 41 def implementations() @application.objectify.append_implementations() end |
#legacy_action(controller, actions, options) ⇒ Object
53 54 55 |
# File 'lib/objectify/rails/routing.rb', line 53 def legacy_action(controller, actions, ) [*actions].each { |action_name| append_action(controller, action_name, ) } end |
#policy_responders(options) ⇒ Object
37 38 39 |
# File 'lib/objectify/rails/routing.rb', line 37 def policy_responders() @application.objectify.append_policy_responders() end |
#resolvers(options) ⇒ Object
45 46 47 |
# File 'lib/objectify/rails/routing.rb', line 45 def resolvers() @application.objectify.append_resolvers() end |
#resources(*args) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/objectify/rails/routing.rb', line 20 def resources(*args) = args. = () controller = @application.objectify.objectify_controller = .merge(:controller => controller) args.each do |resource_name| merged_defaults = objectify_defaults(resource_name, ) @rails_mapper.resources(resource_name, merged_defaults) RESOURCE_ACTIONS.each { |action_name| append_action(resource_name, action_name, ) } end end |
#values(options) ⇒ Object
49 50 51 |
# File 'lib/objectify/rails/routing.rb', line 49 def values() @application.objectify.append_values() end |