Class: GitWorkflow::Story
- Inherits:
-
Object
- Object
- GitWorkflow::Story
- Includes:
- Logging
- Defined in:
- lib/git_workflow/story.rb
Defined Under Namespace
Classes: XmlWrapper
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#story_id ⇒ Object
readonly
Returns the value of attribute story_id.
Instance Method Summary collapse
- #branch_name ⇒ Object
- #comment(message) ⇒ Object
- #finish_state ⇒ Object
-
#initialize(service) ⇒ Story
constructor
A new instance of Story.
- #remote_branch_name ⇒ Object
- #service!(&block) ⇒ Object
- #start_state ⇒ Object
Methods included from Logging
default_logger, included, logger, logger=
Constructor Details
#initialize(service) ⇒ Story
Returns a new instance of Story.
17 18 19 20 |
# File 'lib/git_workflow/story.rb', line 17 def initialize(service) @service = service load_story! end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
15 16 17 |
# File 'lib/git_workflow/story.rb', line 15 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/git_workflow/story.rb', line 14 def name @name end |
#story_id ⇒ Object (readonly)
Returns the value of attribute story_id.
13 14 15 |
# File 'lib/git_workflow/story.rb', line 13 def story_id @story_id end |
Instance Method Details
#branch_name ⇒ Object
22 23 24 |
# File 'lib/git_workflow/story.rb', line 22 def branch_name @local_branch_name ||= GitWorkflow::Configuration.instance.local_branch_convention.to(self) end |
#comment(message) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/git_workflow/story.rb', line 38 def comment() _service!(:post, 'notes') do |xml| xml.note { xml.text() } end end |
#finish_state ⇒ Object
34 35 36 |
# File 'lib/git_workflow/story.rb', line 34 def finish_state @story_type == 'chore' ? 'accepted' : 'finished' end |
#remote_branch_name ⇒ Object
26 27 28 |
# File 'lib/git_workflow/story.rb', line 26 def remote_branch_name @remote_branch_name ||= GitWorkflow::Configuration.instance.remote_branch_convention.to(self) end |
#service!(&block) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/git_workflow/story.rb', line 46 def service!(&block) _service!(:put) do |xml| xml.story { xml.owned_by(GitWorkflow::Configuration.instance.username) yield(xml) if block_given? } end end |
#start_state ⇒ Object
30 31 32 |
# File 'lib/git_workflow/story.rb', line 30 def start_state 'started' end |