Class: Operationable::Callback
- Inherits:
-
Object
- Object
- Operationable::Callback
- Defined in:
- lib/operationable/callback.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#props ⇒ Object
readonly
Returns the value of attribute props.
-
#q_options ⇒ Object
readonly
Returns the value of attribute q_options.
Instance Method Summary collapse
-
#initialize(props, q_options) ⇒ Callback
constructor
A new instance of Callback.
- #params ⇒ Object
- #record ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(props, q_options) ⇒ Callback
Returns a new instance of Callback.
6 7 8 9 |
# File 'lib/operationable/callback.rb', line 6 def initialize(props, ) @props = props = end |
Instance Attribute Details
#props ⇒ Object (readonly)
Returns the value of attribute props.
4 5 6 |
# File 'lib/operationable/callback.rb', line 4 def props @props end |
#q_options ⇒ Object (readonly)
Returns the value of attribute q_options.
4 5 6 |
# File 'lib/operationable/callback.rb', line 4 def end |
Instance Method Details
#params ⇒ Object
19 20 21 |
# File 'lib/operationable/callback.rb', line 19 def params props[:params] end |
#record ⇒ Object
11 12 13 |
# File 'lib/operationable/callback.rb', line 11 def record @record ||= props[:name].constantize.find(props[:id]) end |
#user ⇒ Object
15 16 17 |
# File 'lib/operationable/callback.rb', line 15 def user @user ||= User.find(props[:changed_by_id]) end |