Class: Ghub::Endpoints::Branches::Signature::Root
- Inherits:
-
Object
- Object
- Ghub::Endpoints::Branches::Signature::Root
- Includes:
- Pipeable
- Defined in:
- lib/ghub/endpoints/branches/signature/root.rb
Overview
Provides access to the branch signature API endpoint.
Constant Summary collapse
- PATH =
"repos/%<owner>s/%<repository>s/branches/%<branch>s/protection/required_signatures"
Instance Method Summary collapse
- #create(owner, repository, branch) ⇒ Object
- #destroy(owner, repository, branch) ⇒ Object
-
#initialize(path: PATH) ⇒ Root
constructor
A new instance of Root.
- #show(owner, repository, branch) ⇒ Object
Constructor Details
Instance Method Details
#create(owner, repository, branch) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/ghub/endpoints/branches/signature/root.rb', line 30 def create owner, repository, branch pipe format(path, owner:, repository:, branch:), to(api, :post), try(:parse, catch: JSON::ParserError), validate(response, as: :to_h), to(model, :for) end |
#destroy(owner, repository, branch) ⇒ Object
38 39 40 |
# File 'lib/ghub/endpoints/branches/signature/root.rb', line 38 def destroy owner, repository, branch api.delete format(path, owner:, repository:, branch:) end |
#show(owner, repository, branch) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/ghub/endpoints/branches/signature/root.rb', line 22 def show owner, repository, branch pipe format(path, owner:, repository:, branch:), to(api, :get), try(:parse, catch: JSON::ParserError), validate(response, as: :to_h), to(model, :for) end |