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


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

def initialize(raw_data)
  @raw_data = raw_data
end

Instance Attribute Details

#raw_dataObject

Returns the value of attribute raw_data


4
5
6
# File 'lib/gitlab/google_code_import/repository.rb', line 4

def raw_data
  @raw_data
end

Instance Method Details

#descriptionObject


26
27
28
# File 'lib/gitlab/google_code_import/repository.rb', line 26

def description
  raw_data["description"]
end

#git?Boolean

Returns:

  • (Boolean)

30
31
32
# File 'lib/gitlab/google_code_import/repository.rb', line 30

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

#idObject


14
15
16
# File 'lib/gitlab/google_code_import/repository.rb', line 14

def id
  raw_data["externalId"]
end

#import_urlObject


34
35
36
# File 'lib/gitlab/google_code_import/repository.rb', line 34

def import_url
  raw_data["repositoryUrls"].first
end

#issuesObject


38
39
40
# File 'lib/gitlab/google_code_import/repository.rb', line 38

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

#nameObject


18
19
20
# File 'lib/gitlab/google_code_import/repository.rb', line 18

def name
  raw_data["name"]
end

#summaryObject


22
23
24
# File 'lib/gitlab/google_code_import/repository.rb', line 22

def summary
  raw_data["summary"]
end

#valid?Boolean

Returns:

  • (Boolean)

10
11
12
# File 'lib/gitlab/google_code_import/repository.rb', line 10

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