Class: PGit::StoryBranch::StoryIdParser
- Inherits:
-
Object
- Object
- PGit::StoryBranch::StoryIdParser
- Defined in:
- lib/pgit/story_branch/story_id_parser.rb
Instance Method Summary collapse
-
#initialize(branch_name) ⇒ StoryIdParser
constructor
A new instance of StoryIdParser.
- #parse ⇒ Object
Constructor Details
#initialize(branch_name) ⇒ StoryIdParser
Returns a new instance of StoryIdParser.
2 3 4 |
# File 'lib/pgit/story_branch/story_id_parser.rb', line 2 def initialize(branch_name) @branch_name = branch_name end |
Instance Method Details
#parse ⇒ Object
6 7 8 9 10 |
# File 'lib/pgit/story_branch/story_id_parser.rb', line 6 def parse raise PGit::Error::User, "The current branch is not associated with a story. Does not have a story id." unless @branch_name.match(/\d+$/) @branch_name.match(/\d+$/)[0] end |