Class: OpenPull::PullRequestDecorator
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- OpenPull::PullRequestDecorator
- Defined in:
- lib/openpull/pull_request_decorator.rb
Instance Method Summary collapse
Instance Method Details
#labels ⇒ Object
15 16 17 18 19 20 |
# File 'lib/openpull/pull_request_decorator.rb', line 15 def labels issue = rels[:issue].get.data labels = issue.rels[:labels].get.data labels.map { |l| l.name.yellow }.join(', ') end |
#mergeable ⇒ Object
35 36 37 |
# File 'lib/openpull/pull_request_decorator.rb', line 35 def mergeable super ? 'Yes'.green : 'No'.red end |
#status ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/openpull/pull_request_decorator.rb', line 22 def status state = rels[:statuses].get.data.map(&:state).first case state when 'success' state.green when 'pending' state.yellow else '--'.red end end |
#title ⇒ Object
3 4 5 6 7 8 |
# File 'lib/openpull/pull_request_decorator.rb', line 3 def title title = super return title if title.size <= 80 title[0, 80] + '...' end |
#user(other) ⇒ Object
10 11 12 13 |
# File 'lib/openpull/pull_request_decorator.rb', line 10 def user(other) user = super().login user == other ? user.blue : user end |