Class: Lotus::Routing::Resource::Options Private
- Inherits:
-
Object
- Object
- Lotus::Routing::Resource::Options
- Defined in:
- lib/lotus/routing/resource/options.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Options for RESTFul resource(s)
Instance Attribute Summary collapse
- #actions ⇒ Object readonly private
Instance Method Summary collapse
-
#[](key) ⇒ Object?
private
Return the option for the given key.
-
#initialize(actions, options = {}) ⇒ Options
constructor
private
Initialize the options for: * Lotus::Router#resource * Lotus::Router#resources.
-
#merge(hash) ⇒ Hash
private
Merge the current options with the given hash, without mutating self.
Constructor Details
#initialize(actions, options = {}) ⇒ Options
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize the options for:
* Lotus::Router#resource
* Lotus::Router#resources
39 40 41 42 43 44 45 |
# File 'lib/lotus/routing/resource/options.rb', line 39 def initialize(actions, = {}) only = Array(.delete(:only) || actions) except = Array(.delete(:except)) @actions = ( actions & only ) - except @options = end |
Instance Attribute Details
#actions ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/lotus/routing/resource/options.rb', line 14 def actions @actions end |
Instance Method Details
#[](key) ⇒ Object?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the option for the given key
56 57 58 |
# File 'lib/lotus/routing/resource/options.rb', line 56 def [](key) @options[key] end |
#merge(hash) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Merge the current options with the given hash, without mutating self.
68 69 70 |
# File 'lib/lotus/routing/resource/options.rb', line 68 def merge(hash) @options.merge(hash) end |