Class: Ghub::Endpoints::Pulls::Actions::Index

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

Overview

Handles a repository index action.

Instance Method Summary collapse

Instance Method Details

#call(owner, repository, **parameters) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/ghub/endpoints/pulls/actions/index.rb', line 15

def call owner, repository, **parameters
  pipe(
    api.get("repos/#{owner}/#{repository}/pulls", **parameters),
    try(:parse, catch: JSON::ParserError),
    fmap { |body| {body:} },
    validate(response, as: :to_h),
    as(:fetch, :body),
    map { |item| model.for(**item) }
  )
end