Class: HustleAndFlow::Formatters::IssueDetailFormatter

Inherits:
Object
  • Object
show all
Includes:
Utils::String
Defined in:
lib/hustle_and_flow/formatters/issue_detail_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::String

#titleize, #underscore

Constructor Details

#initialize(issue) ⇒ IssueDetailFormatter



10
11
12
# File 'lib/hustle_and_flow/formatters/issue_detail_formatter.rb', line 10

def initialize(issue)
  self.issue = issue
end

Instance Attribute Details

#issueObject

Returns the value of attribute issue.



8
9
10
# File 'lib/hustle_and_flow/formatters/issue_detail_formatter.rb', line 8

def issue
  @issue
end

Instance Method Details

#to_hashObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/hustle_and_flow/formatters/issue_detail_formatter.rb', line 14

def to_hash
  {
    header:  {
      format: issue_header_formatting,
      value:  issue_header,
    },
    divider: {
      format: issue_divider_formatting,
      value:  nil,
    },
    contact: {
      format: issue_contact_formatting,
      value:  issue_contact,
    },
    body:    {
      format: issue_body_formatting,
      value:  issue.body,
    },
  }
end