Class: Gitlab::GoogleCodeImport::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/google_code_import/repository.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_data) ⇒ Repository

Returns a new instance of Repository.


8
9
10
# File 'lib/gitlab/google_code_import/repository.rb', line 8

def initialize(raw_data)
  @raw_data = raw_data
end

Instance Attribute Details

#raw_dataObject

Returns the value of attribute raw_data


6
7
8
# File 'lib/gitlab/google_code_import/repository.rb', line 6

def raw_data
  @raw_data
end

Instance Method Details

#descriptionObject


28
29
30
# File 'lib/gitlab/google_code_import/repository.rb', line 28

def description
  raw_data["description"]
end

#git?Boolean

Returns:

  • (Boolean)

32
33
34
# File 'lib/gitlab/google_code_import/repository.rb', line 32

def git?
  raw_data["versionControlSystem"] == "git"
end

#idObject


16
17
18
# File 'lib/gitlab/google_code_import/repository.rb', line 16

def id
  raw_data["externalId"]
end

#import_urlObject


36
37
38
# File 'lib/gitlab/google_code_import/repository.rb', line 36

def import_url
  raw_data["repositoryUrls"].first
end

#issuesObject


40
41
42
# File 'lib/gitlab/google_code_import/repository.rb', line 40

def issues
  raw_data["issues"] && raw_data["issues"]["items"]
end

#nameObject


20
21
22
# File 'lib/gitlab/google_code_import/repository.rb', line 20

def name
  raw_data["name"]
end

#summaryObject


24
25
26
# File 'lib/gitlab/google_code_import/repository.rb', line 24

def summary
  raw_data["summary"]
end

#valid?Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/gitlab/google_code_import/repository.rb', line 12

def valid?
  raw_data.is_a?(Hash) && raw_data["kind"] == "projecthosting#project"
end