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.
Instance Method Summary collapse
-
#initialize(props) ⇒ Callback
constructor
A new instance of Callback.
- #record ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(props) ⇒ Callback
Returns a new instance of Callback.
6 7 8 |
# 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 |
Instance Method Details
#record ⇒ Object
10 11 12 |
# File 'lib/operationable/callback.rb', line 10 def record @record ||= props[:name].constantize.find(props[:id]) end |
#user ⇒ Object
14 15 16 |
# File 'lib/operationable/callback.rb', line 14 def user @user ||= User.find(props[:changed_by_id]) end |