Class: Ghub::Endpoints::Repositories::Actions::Create

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

Overview

Handles a repository create action.

Instance Method Summary collapse

Instance Method Details

#call(kind, body, owner: nil, **parameters) ⇒ Object



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

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