Class: Gitea::OrgsResource

Inherits:
Resource show all
Defined in:
lib/gitea/resources/orgs.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Gitea::Resource

Instance Method Details

#create(name:, **args) ⇒ Object



13
14
15
# File 'lib/gitea/resources/orgs.rb', line 13

def create(name:, **args)
  Org.new post_request("orgs", body: args.merge({username: name})).body
end

#delete(name:) ⇒ Object



21
22
23
# File 'lib/gitea/resources/orgs.rb', line 21

def delete(name:)
  delete_request("orgs/#{name}")
end

#get(name:) ⇒ Object



9
10
11
# File 'lib/gitea/resources/orgs.rb', line 9

def get(name:)
  Org.new get_request("orgs/#{name}").body
end

#list(**params) ⇒ Object



4
5
6
7
# File 'lib/gitea/resources/orgs.rb', line 4

def list(**params)
  response = get_request("orgs", params: params)
  Collection.from_response(response, type: Org)
end

#update(name:, **args) ⇒ Object



17
18
19
# File 'lib/gitea/resources/orgs.rb', line 17

def update(name:, **args)
  Org.new patch_request("orgs/#{name}", body: args).body
end