class Startling::Github::PullRequest

Attributes

attributes[R]
labels[RW]

Public Class Methods

new(attributes, prefetch_data: true) click to toggle source
# File lib/startling/github/pull_request.rb, line 7
def initialize(attributes, prefetch_data: true)
  @attributes = attributes
  prefetch_data if prefetch_data
end

Public Instance Methods

author() click to toggle source
# File lib/startling/github/pull_request.rb, line 46
def author
  @author ||= attributes.user.rels[:self].get.data.name
end
branch() click to toggle source
# File lib/startling/github/pull_request.rb, line 20
def branch
  attributes.head.ref
end
created_at() click to toggle source
# File lib/startling/github/pull_request.rb, line 38
def created_at
  attributes.created_at
end
id() click to toggle source
# File lib/startling/github/pull_request.rb, line 12
def id
  attributes.number
end
in_progress?() click to toggle source
# File lib/startling/github/pull_request.rb, line 24
def in_progress?
  return true if Startling.wip_labels.empty?

  (label_names & Startling.wip_labels).size > 0
end
label_names() click to toggle source
# File lib/startling/github/pull_request.rb, line 30
def label_names
  labels.map(&:name)
end
title() click to toggle source
# File lib/startling/github/pull_request.rb, line 16
def title
  attributes.title
end
updated_at() click to toggle source
# File lib/startling/github/pull_request.rb, line 42
def updated_at
  attributes.updated_at
end
url() click to toggle source
# File lib/startling/github/pull_request.rb, line 34
def url
  attributes.rels[:html].href
end

Private Instance Methods

prefetch_data() click to toggle source
# File lib/startling/github/pull_request.rb, line 52
def prefetch_data
  author
end