Class: BitbucketServer::Representation::Repo
- Inherits:
-
Base
- Object
- Base
- BitbucketServer::Representation::Repo
show all
- Defined in:
- lib/bitbucket_server/representation/repo.rb
Instance Attribute Summary
Attributes inherited from Base
#raw
Instance Method Summary
collapse
Methods inherited from Base
convert_timestamp, decorate, #initialize
Instance Method Details
#browse_url ⇒ Object
18
19
20
21
22
|
# File 'lib/bitbucket_server/representation/repo.rb', line 18
def browse_url
raw.dig('links', 'self').first.fetch('href')
end
|
#clone_url ⇒ Object
24
25
26
|
# File 'lib/bitbucket_server/representation/repo.rb', line 24
def clone_url
raw['links']['clone'].find { |link| link['name'].starts_with?('http') }.fetch('href')
end
|
#description ⇒ Object
28
29
30
|
# File 'lib/bitbucket_server/representation/repo.rb', line 28
def description
raw['description']
end
|
#full_name ⇒ Object
32
33
34
|
# File 'lib/bitbucket_server/representation/repo.rb', line 32
def full_name
"#{project_name}/#{name}"
end
|
#issues_enabled? ⇒ Boolean
36
37
38
|
# File 'lib/bitbucket_server/representation/repo.rb', line 36
def issues_enabled?
true
end
|
#name ⇒ Object
40
41
42
|
# File 'lib/bitbucket_server/representation/repo.rb', line 40
def name
raw['name']
end
|
#project ⇒ Object
56
57
58
|
# File 'lib/bitbucket_server/representation/repo.rb', line 56
def project
raw['project']
end
|
#project_key ⇒ Object
6
7
8
|
# File 'lib/bitbucket_server/representation/repo.rb', line 6
def project_key
raw.dig('project', 'key')
end
|
#project_name ⇒ Object
10
11
12
|
# File 'lib/bitbucket_server/representation/repo.rb', line 10
def project_name
raw.dig('project', 'name')
end
|
#slug ⇒ Object
14
15
16
|
# File 'lib/bitbucket_server/representation/repo.rb', line 14
def slug
raw['slug']
end
|
#to_s ⇒ Object
60
61
62
|
# File 'lib/bitbucket_server/representation/repo.rb', line 60
def to_s
full_name
end
|
#valid? ⇒ Boolean
44
45
46
|
# File 'lib/bitbucket_server/representation/repo.rb', line 44
def valid?
raw['scmId'] == 'git'
end
|
#visibility_level ⇒ Object