Skip to content

Instantly share code, notes, and snippets.

@cored
Created April 2, 2013 18:35
Show Gist options
  • Select an option

  • Save cored/5294905 to your computer and use it in GitHub Desktop.

Select an option

Save cored/5294905 to your computer and use it in GitHub Desktop.
module TM
module Commands
class LastTask
def initialize(provider_handler, formatter, attributes = '')
@provider_handler = provider_handler
@formatter = formatter
@attributes = attributes.extend(TM::StringExtensions).to_hash
end
def execute
project = @provider_handler.project(@attributes)
ticket = project.tickets.last
@formatter.before(ticket)
@formatter.format(ticket)
@formatter.after
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment