Class: Jirify::UI::SprintTable
- Inherits:
-
Object
- Object
- Jirify::UI::SprintTable
- Defined in:
- lib/jirify/ui/sprint_table.rb
Instance Attribute Summary collapse
-
#issues ⇒ Object
readonly
Returns the value of attribute issues.
Instance Method Summary collapse
-
#initialize(issues) ⇒ SprintTable
constructor
A new instance of SprintTable.
- #to_table(options) ⇒ Object
Constructor Details
#initialize(issues) ⇒ SprintTable
Returns a new instance of SprintTable.
7 8 9 |
# File 'lib/jirify/ui/sprint_table.rb', line 7 def initialize(issues) @issues = issues end |
Instance Attribute Details
#issues ⇒ Object (readonly)
Returns the value of attribute issues.
6 7 8 |
# File 'lib/jirify/ui/sprint_table.rb', line 6 def issues @issues end |
Instance Method Details
#to_table(options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jirify/ui/sprint_table.rb', line 11 def to_table() return '' if issues.empty? # group issues by status name grouped_issues = issues.group_by do |issue| [:all_columns] ? issue.status.name : issue.status.statusCategory['name'] end Terminal::Table.new( headings: headings(grouped_issues), rows: issues_as_rows(grouped_issues.values, ), style: table_style ) end |