Class: Gitlab::FogbugzImport::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/fogbugz_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/fogbugz_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/fogbugz_import/repository.rb', line 4

def raw_data
  @raw_data
end

Instance Method Details

#idObject


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

def id
  raw_data['ixProject']
end

#nameObject


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

def name
  raw_data['sProject']
end

#pathObject


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

def path
  safe_name.gsub(/[\s]/, '_')
end

#safe_nameObject


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

def safe_name
  name.gsub(/[^\s\w.-]/, '')
end

#valid?Boolean

Returns:

  • (Boolean)

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

def valid?
  raw_data.is_a?(Hash)
end