Class: GhIssues::Issue
- Inherits:
-
Hash
- Object
- Hash
- GhIssues::Issue
- 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
-
#initialize(hash) ⇒ Issue
constructor
A new instance of Issue.
- #to_string ⇒ Object
- #to_title_and_labels ⇒ Object
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_string ⇒ Object
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_labels ⇒ Object
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 |