Class: GhIssues::Issue

Inherits:
Hash
  • Object
show all
Defined in:
lib/gh-issues/issue.rb

Overview

TODO:

Separate info and formatter in 2 classes.

I hold info of an issue and perform output format.

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Issue

Returns a new instance of Issue.



9
10
11
# File 'lib/gh-issues/issue.rb', line 9

def initialize hash
  self.merge!(hash)
end

Instance Method Details

#to_stringObject



17
18
19
# File 'lib/gh-issues/issue.rb', line 17

def to_string
  "#{to_title_and_labels}\n#{self[:body].color(:blue)}"
end

#to_title_and_labelsObject



13
14
15
# File 'lib/gh-issues/issue.rb', line 13

def to_title_and_labels
  "#{format_id} #{self[:title].color(:green)} #{self[:labels].join(', ')}"
end