Class: Gitlab::FogbugzImport::Repository
- Inherits:
-
Object
- Object
- Gitlab::FogbugzImport::Repository
- Defined in:
- lib/gitlab/fogbugz_import/repository.rb
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
Returns the value of attribute raw_data.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(raw_data) ⇒ Repository
constructor
A new instance of Repository.
- #name ⇒ Object
- #path ⇒ Object
- #safe_name ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(raw_data) ⇒ Repository
Returns a new instance of Repository.
8 9 10 |
# File 'lib/gitlab/fogbugz_import/repository.rb', line 8 def initialize(raw_data) @raw_data = raw_data end |
Instance Attribute Details
#raw_data ⇒ Object
Returns the value of attribute raw_data.
6 7 8 |
# File 'lib/gitlab/fogbugz_import/repository.rb', line 6 def raw_data @raw_data end |
Instance Method Details
#id ⇒ Object
16 17 18 |
# File 'lib/gitlab/fogbugz_import/repository.rb', line 16 def id raw_data['ixProject'] end |
#name ⇒ Object
20 21 22 |
# File 'lib/gitlab/fogbugz_import/repository.rb', line 20 def name raw_data['sProject'] end |
#path ⇒ Object
28 29 30 |
# File 'lib/gitlab/fogbugz_import/repository.rb', line 28 def path safe_name.gsub(/\s/, '_') end |
#safe_name ⇒ Object
24 25 26 |
# File 'lib/gitlab/fogbugz_import/repository.rb', line 24 def safe_name name.gsub(/[^\s\w.-]/, '') end |
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/gitlab/fogbugz_import/repository.rb', line 12 def valid? raw_data.is_a?(Hash) end |