class PivotalIntegration::Command::Mark

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

Constants

STATES

Public Instance Methods

run(*arguments) click to toggle source

Assigns story to user. @return [void]

# File lib/pivotal-integration/command/mark.rb, line 27
def run(*arguments)
  state = arguments.first
  state = choose_state if state.nil? or !STATES.include?(state)

  PivotalIntegration::Util::Story.mark(story, state)
end

Private Instance Methods

choose_state() click to toggle source
# File lib/pivotal-integration/command/mark.rb, line 36
def choose_state
  choose do |menu|
    menu.prompt = 'Choose story state from above list: '
    STATES.each do |state|
      menu.choice(state)
    end
  end
end