Class: GhDraftIssueConverter::Repository
- Inherits:
-
Object
- Object
- GhDraftIssueConverter::Repository
- Defined in:
- lib/gh_draft_issues_converter/gh_draft_issues_converter.rb
Instance Attribute Summary collapse
-
#full_repository_name ⇒ Object
readonly
Returns the value of attribute full_repository_name.
Instance Method Summary collapse
-
#initialize(full_repository_name) ⇒ Repository
constructor
A new instance of Repository.
- #name ⇒ Object
- #owner ⇒ Object
Constructor Details
#initialize(full_repository_name) ⇒ Repository
Returns a new instance of Repository.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/gh_draft_issues_converter/gh_draft_issues_converter.rb', line 53 def initialize(full_repository_name) parts = full_repository_name.split('/') if full_repository_name.include?('/') parts = full_repository_name.split('/') if parts.length != 2 puts "repository_name is invalid" exit 1 elsif parts[0].empty? || parts[1].empty? puts "repository_name is invalid" exit 1 else # OK end else puts "repository_name is invalid" exit 1 end @full_repository_name = full_repository_name end |
Instance Attribute Details
#full_repository_name ⇒ Object (readonly)
Returns the value of attribute full_repository_name.
52 53 54 |
# File 'lib/gh_draft_issues_converter/gh_draft_issues_converter.rb', line 52 def full_repository_name @full_repository_name end |
Instance Method Details
#name ⇒ Object
76 77 78 |
# File 'lib/gh_draft_issues_converter/gh_draft_issues_converter.rb', line 76 def name full_repository_name.split("/")[1] end |
#owner ⇒ Object
80 81 82 |
# File 'lib/gh_draft_issues_converter/gh_draft_issues_converter.rb', line 80 def owner full_repository_name.split("/")[0] end |