Class: JiraIssues::JiraIssuesNavigator

Inherits:
Object
  • Object
show all
Includes:
JiraIssueStats
Defined in:
lib/jira_issues/jira_issues_navigator.rb

Instance Method Summary collapse

Methods included from JiraIssueStats

#closed_by_week, #created_by_week

Constructor Details

#initialize(issues) ⇒ JiraIssuesNavigator

Returns a new instance of JiraIssuesNavigator.



5
6
7
# File 'lib/jira_issues/jira_issues_navigator.rb', line 5

def initialize(issues)
  @issues = issues
end

Instance Method Details

#allObject



20
21
22
# File 'lib/jira_issues/jira_issues_navigator.rb', line 20

def all
  JiraIssuesNavigator.new @issues
end

#blockedObject



28
29
30
# File 'lib/jira_issues/jira_issues_navigator.rb', line 28

def blocked
  JiraIssuesNavigator.new @issues.select {|i| i[:filter_status] == JiraWorkflow::BLOCKED}
end

#closedObject



36
37
38
# File 'lib/jira_issues/jira_issues_navigator.rb', line 36

def closed
  JiraIssuesNavigator.new @issues.select {|i| i[:filter_status] == JiraWorkflow::CLOSED}
end

#doneObject



49
50
51
# File 'lib/jira_issues/jira_issues_navigator.rb', line 49

def done
  closed
end

#in_progressObject



32
33
34
# File 'lib/jira_issues/jira_issues_navigator.rb', line 32

def in_progress
  JiraIssuesNavigator.new @issues.select {|i| i[:filter_status] == JiraWorkflow::IN_PROGRESS}
end

#ipObject



53
54
55
# File 'lib/jira_issues/jira_issues_navigator.rb', line 53

def ip 
  in_progress
end

#issuesObject



9
10
11
# File 'lib/jira_issues/jira_issues_navigator.rb', line 9

def issues 
  @issues
end

#openObject



24
25
26
# File 'lib/jira_issues/jira_issues_navigator.rb', line 24

def open
  JiraIssuesNavigator.new @issues.select {|i| i[:filter_status] == JiraWorkflow::OPEN}
end

#to_jsonObject



13
14
15
16
17
18
# File 'lib/jira_issues/jira_issues_navigator.rb', line 13

def to_json
  json = []
  @issues.each do |i|
    json << i.to_json
  end
end

#todoObject

aliases



45
46
47
# File 'lib/jira_issues/jira_issues_navigator.rb', line 45

def todo
  open
end

#with_status(status: selected_status) ⇒ Object



40
41
42
# File 'lib/jira_issues/jira_issues_navigator.rb', line 40

def with_status(status: selected_status)
  JiraIssuesNavigator.new @issues.select {|i| i[:filter_status] == @issue_states[selected_status]}
end