Class: ActiveAction::Action
- Inherits:
-
Object
- Object
- ActiveAction::Action
- Defined in:
- lib/active_action/action.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
Instance Method Summary collapse
-
#initialize(action, options = {}) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(action, options = {}) ⇒ Action
Returns a new instance of Action.
4 5 6 7 8 9 10 |
# File 'lib/active_action/action.rb', line 4 def initialize(action, = {}) .assert_valid_keys(:scope, :label, :path, :scopes) @action = action @label = [:label] || @action.to_s @scopes = [:scopes] || Array.wrap([:scope] || :all) @path = ([:path] || @action).to_s end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/active_action/action.rb', line 3 def action @action end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/active_action/action.rb', line 3 def label @label end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/active_action/action.rb', line 3 def path @path end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
3 4 5 |
# File 'lib/active_action/action.rb', line 3 def scopes @scopes end |