Class: HustleAndFlow::Formatters::IssueTableFormatter
- Inherits:
-
Object
- Object
- HustleAndFlow::Formatters::IssueTableFormatter
- Includes:
- Utils::String
- Defined in:
- lib/hustle_and_flow/formatters/issue_table_formatter.rb
Instance Attribute Summary collapse
-
#issues ⇒ Object
Returns the value of attribute issues.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(issues) ⇒ IssueTableFormatter
constructor
A new instance of IssueTableFormatter.
- #to_ary ⇒ Object
Methods included from Utils::String
Constructor Details
#initialize(issues) ⇒ IssueTableFormatter
11 12 13 |
# File 'lib/hustle_and_flow/formatters/issue_table_formatter.rb', line 11 def initialize(issues) self.issues = issues end |
Instance Attribute Details
#issues ⇒ Object
Returns the value of attribute issues.
8 9 10 |
# File 'lib/hustle_and_flow/formatters/issue_table_formatter.rb', line 8 def issues @issues end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/hustle_and_flow/formatters/issue_table_formatter.rb', line 8 def title @title end |
Instance Method Details
#to_ary ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/hustle_and_flow/formatters/issue_table_formatter.rb', line 15 def to_ary issues.map do |issue| [ { format: number_formatting(issue), value: "##{issue.number}", }, { format: contact_formatting(issue), value: issue.contact, }, { format: category_formatting(issue), value: titleize(issue.category), }, { format: title_formatting(issue), value: issue.title, }, ] end end |