Class: Operationable::Callback

Inherits:
Object
  • Object
show all
Defined in:
lib/operationable/callback.rb

Direct Known Subclasses

Operation::Callback

Instance Attribute Summary collapse

Instance Method Summary collapse

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, q_options)
  @props = props
  @q_options = q_options
end

Instance Attribute Details

#propsObject (readonly)

Returns the value of attribute props.



4
5
6
# File 'lib/operationable/callback.rb', line 4

def props
  @props
end

#q_optionsObject (readonly)

Returns the value of attribute q_options.



4
5
6
# File 'lib/operationable/callback.rb', line 4

def q_options
  @q_options
end

Instance Method Details

#paramsObject



19
20
21
# File 'lib/operationable/callback.rb', line 19

def params
  props[:params]
end

#recordObject



11
12
13
# File 'lib/operationable/callback.rb', line 11

def record
  @record ||= props[:name].constantize.find(props[:id])
end

#userObject



15
16
17
# File 'lib/operationable/callback.rb', line 15

def user
  @user ||= User.find(props[:changed_by_id])
end