Class: PivotalIntegration::Command::Assign

Inherits:
Base
  • Object
show all
Defined in:
lib/pivotal-integration/command/assign.rb

Overview

The class that encapsulates assigning current Pivotal Tracker Story to a user

Instance Method Summary collapse

Methods inherited from Base

desc, #initialize, #story

Constructor Details

This class inherits a constructor from PivotalIntegration::Command::Base

Instance Method Details

#run(*arguments) ⇒ void

This method returns an undefined value.

Assigns story to user.



25
26
27
28
29
30
31
32
33
# File 'lib/pivotal-integration/command/assign.rb', line 25

def run(*arguments)
  username = arguments.first

  if username.nil? or !memberships.include?(username)
    username = choose_user
  end

  PivotalIntegration::Util::Story.assign(story, username)
end