Class: Octopolo::Pivotal::StoryCommenter

Inherits:
Object
  • Object
show all
Defined in:
lib/octopolo/pivotal/story_commenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(story_id, comment) ⇒ StoryCommenter

Returns a new instance of StoryCommenter.



9
10
11
12
# File 'lib/octopolo/pivotal/story_commenter.rb', line 9

def initialize(story_id, comment)
  self.story = Pivotal::Client.new.find_story(story_id)
  self.comment = comment
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



7
8
9
# File 'lib/octopolo/pivotal/story_commenter.rb', line 7

def comment
  @comment
end

#storyObject

Returns the value of attribute story.



6
7
8
# File 'lib/octopolo/pivotal/story_commenter.rb', line 6

def story
  @story
end

Instance Method Details

#performObject



14
15
16
# File 'lib/octopolo/pivotal/story_commenter.rb', line 14

def perform
  story.notes.new(:owner => story, :text => comment).create
end