Class: Octopolo::Jira::StoryCommenter
- Inherits:
-
Object
- Object
- Octopolo::Jira::StoryCommenter
- Includes:
- ConfigWrapper
- Defined in:
- lib/octopolo/jira/story_commenter.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#issue ⇒ Object
Returns the value of attribute issue.
Attributes included from ConfigWrapper
Instance Method Summary collapse
-
#initialize(issue_id, comment) ⇒ StoryCommenter
constructor
A new instance of StoryCommenter.
- #perform ⇒ Object
Constructor Details
#initialize(issue_id, comment) ⇒ StoryCommenter
Returns a new instance of StoryCommenter.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/octopolo/jira/story_commenter.rb', line 11 def initialize(issue_id, comment) Jiralicious.configure do |jira_config| jira_config.username = config.jira_user jira_config.password = config.jira_password jira_config.uri = config.jira_url end begin self.issue = Jiralicious::Issue.find issue_id rescue => e puts "Error: Invalid Jira Issue #{issue_id}" end self.comment = comment end |
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
9 10 11 |
# File 'lib/octopolo/jira/story_commenter.rb', line 9 def comment @comment end |
#issue ⇒ Object
Returns the value of attribute issue.
8 9 10 |
# File 'lib/octopolo/jira/story_commenter.rb', line 8 def issue @issue end |
Instance Method Details
#perform ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/octopolo/jira/story_commenter.rb', line 25 def perform begin issue.comments.add(comment) rescue => e puts "Error: Failed to comment on Jira Issue. \nException: #{e}" end end |