Class: Ghub::Endpoints::Repositories::Actions::Patch

Inherits:
Object
  • Object
show all
Includes:
Pipeable
Defined in:
lib/ghub/endpoints/repositories/actions/patch.rb

Overview

Handles a repository patch action.

Instance Method Summary collapse

Instance Method Details

#call(owner, id, body, **parameters) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ghub/endpoints/repositories/actions/patch.rb', line 22

def call owner, id, body, **parameters
  path.patch(owner, id).bind do |url_path|
    pipe body,
         validate(request),
         insert(url_path, at: 0),
         insert(parameters),
         to(api, :patch),
         try(:parse, catch: JSON::ParserError),
         validate(response, as: :to_h),
         to(model, :for)
  end
end