Class: HecksAdapters::ResourceServer::Methods::Update
- Inherits:
-
Object
- Object
- HecksAdapters::ResourceServer::Methods::Update
- Defined in:
- lib/methods/update.rb
Overview
Update a resource
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #call(id:, body:, module_name:) ⇒ Object
-
#initialize(application_adapter:) ⇒ Update
constructor
A new instance of Update.
- #status ⇒ Object
Constructor Details
#initialize(application_adapter:) ⇒ Update
Returns a new instance of Update.
9 10 11 |
# File 'lib/methods/update.rb', line 9 def initialize(application_adapter:) @application_adapter = application_adapter end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
7 8 9 |
# File 'lib/methods/update.rb', line 7 def result @result end |
Instance Method Details
#call(id:, body:, module_name:) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/methods/update.rb', line 13 def call(id:, body:, module_name:) @id = id @body = body.read @module_name = module_name.to_sym run_command convert_to_json self end |
#status ⇒ Object
22 23 24 25 |
# File 'lib/methods/update.rb', line 22 def status return 500 if command.result[:errors].count.positive? 200 end |