Class: Ghub::Endpoints::Repositories::Actions::Index

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

Overview

Handles a repository index action.

Instance Method Summary collapse

Instance Method Details

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



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

def call kind, owner, **parameters
  pipe(
    path.index(kind, owner),
    insert(parameters),
    to(api, :get),
    try(:parse, catch: JSON::ParserError),
    fmap { |body| {body:} },
    validate(response, as: :to_h),
    as(:fetch, :body),
    map { |item| model.for(**item) }
  )
end