Class: RapidTransit::Action::InstanceMethod
- Defined in:
- lib/rapid_transit/action/instance_method.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Attributes inherited from Base
#action_name, #block, #condition, #key, #options
Instance Method Summary collapse
-
#initialize(action_name, *args) ⇒ InstanceMethod
constructor
A new instance of InstanceMethod.
- #requires_attributes? ⇒ Boolean
- #requires_no_attributes? ⇒ Boolean
- #result_saved? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(action_name, *args) ⇒ InstanceMethod
Returns a new instance of InstanceMethod.
5 6 7 8 9 |
# File 'lib/rapid_transit/action/instance_method.rb', line 5 def initialize(action_name, *args) super @attributes = @options @validations += [:attributes] end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/rapid_transit/action/instance_method.rb', line 3 def attributes @attributes end |
Instance Method Details
#requires_attributes? ⇒ Boolean
15 16 17 |
# File 'lib/rapid_transit/action/instance_method.rb', line 15 def requires_attributes? ![:save, :destroy].include? action_name end |
#requires_no_attributes? ⇒ Boolean
19 20 21 |
# File 'lib/rapid_transit/action/instance_method.rb', line 19 def requires_no_attributes? [:save, :destroy].include? action_name end |
#result_saved? ⇒ Boolean
11 12 13 |
# File 'lib/rapid_transit/action/instance_method.rb', line 11 def result_saved? ![:destroy].include? action_name end |