Class: Gearhead::Actions::Update
- Inherits:
-
Object
- Object
- Gearhead::Actions::Update
- Defined in:
- lib/gearhead/actions/update.rb
Instance Attribute Summary collapse
-
#gear ⇒ Object
readonly
Returns the value of attribute gear.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Class Method Summary collapse
Instance Method Summary collapse
-
#build ⇒ Object
todo.
-
#initialize(gear, request, resource:) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(gear, request, resource:) ⇒ Update
Returns a new instance of Update.
11 12 13 14 15 |
# File 'lib/gearhead/actions/update.rb', line 11 def initialize(gear, request, resource:) @gear = gear @request = request @resource = resource end |
Instance Attribute Details
#gear ⇒ Object (readonly)
Returns the value of attribute gear.
10 11 12 |
# File 'lib/gearhead/actions/update.rb', line 10 def gear @gear end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
10 11 12 |
# File 'lib/gearhead/actions/update.rb', line 10 def request @request end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
10 11 12 |
# File 'lib/gearhead/actions/update.rb', line 10 def resource @resource end |
Class Method Details
.build(gear, request, resource:) ⇒ Object
6 7 8 |
# File 'lib/gearhead/actions/update.rb', line 6 def self.build(gear, request, resource:) new(gear, request, resource: resource).build end |
Instance Method Details
#build ⇒ Object
todo
18 19 20 21 22 |
# File 'lib/gearhead/actions/update.rb', line 18 def build params = ActionController::Parameters.new(@request.params).require(:post).permit(:person_id, :private) @resource.assign_attributes(params) @resource end |