Class: Xavius::Actions::Context
- Inherits:
-
Object
- Object
- Xavius::Actions::Context
- Defined in:
- lib/xavius/actions/context.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#resource_class ⇒ Object
readonly
Returns the value of attribute resource_class.
Instance Method Summary collapse
-
#initialize(**params) ⇒ Context
constructor
A new instance of Context.
- #resource_params ⇒ Object
Constructor Details
#initialize(**params) ⇒ Context
Returns a new instance of Context.
6 7 8 9 10 |
# File 'lib/xavius/actions/context.rb', line 6 def initialize(**params) @resource = params.fetch(:resource) @resource_class = @resource.class @resource_params = params.fetch(:resource_params) end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'lib/xavius/actions/context.rb', line 4 def resource @resource end |
#resource_class ⇒ Object (readonly)
Returns the value of attribute resource_class.
4 5 6 |
# File 'lib/xavius/actions/context.rb', line 4 def resource_class @resource_class end |
Instance Method Details
#resource_params ⇒ Object
12 13 14 |
# File 'lib/xavius/actions/context.rb', line 12 def resource_params @resource_params.call end |