Class: Jira::Command::Sprint

Inherits:
Base
  • Object
show all
Defined in:
lib/jira/commands/sprint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(active) ⇒ Sprint

Returns a new instance of Sprint.



16
17
18
# File 'lib/jira/commands/sprint.rb', line 16

def initialize(active)
  self.active = active
end

Instance Attribute Details

#activeObject

Returns the value of attribute active.



14
15
16
# File 'lib/jira/commands/sprint.rb', line 14

def active
  @active
end

Instance Method Details

#runObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/jira/commands/sprint.rb', line 21

def run
  return if rapid_view.empty?
  return if no_sprints?
  return if sprint.empty?
  if active == active
    sprint_id = info['sprint']['id']
    jql = "sprint = #{sprint_id}"
    Command::Tickets.new(jql).run
  else
    render_table(
      [ 'Sprint', 'State' ],
      [ [ info['sprint']['name'], info['sprint']['state'] ] ]
    )
  end
end