class HornOfPlenty::Adapters::Github::Parsers::PullRequest

Public Class Methods

to_model(raw_item) click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/pull_request.rb, line 29
def self.to_model(raw_item)
  return NullObjects::PullRequest.instance unless raw_item

  Models::PullRequest.from_parser(parser: new(raw: raw_item))
end

Public Instance Methods

labels() click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/pull_request.rb, line 12
def labels
  []
end
merger_id() click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/pull_request.rb, line 16
def merger_id
  @merger_id                             ||= parse_text(raw, 'merged_by/:/login')
end
status() click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/pull_request.rb, line 20
def status
  @status                                ||= begin
    status    = parse_text(raw, 'state')
    merged_at = parse_text(raw, 'merged_at')

    merged_at ? 'merged' : status
  end
end