Class: Dependabot::PullRequest

Inherits:
Object
  • Object
show all
Includes:
Straw::Memoizable
Defined in:
lib/dependabot/pull_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nwo:, base:, head:, dependency:) ⇒ PullRequest

Returns a new instance of PullRequest.



9
10
11
12
13
14
# File 'lib/dependabot/pull_request.rb', line 9

def initialize(nwo:, base:, head:, dependency:)
  @nwo = nwo
  @base = base
  @head = head
  @dependency = dependency
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



7
8
9
# File 'lib/dependabot/pull_request.rb', line 7

def base
  @base
end

#headObject (readonly)

Returns the value of attribute head.



7
8
9
# File 'lib/dependabot/pull_request.rb', line 7

def head
  @head
end

Instance Method Details

#commit_messageObject



16
17
18
19
20
21
22
23
24
# File 'lib/dependabot/pull_request.rb', line 16

def commit_message
  memoize(:commit_message) do
    <<~COMMIT
      #{title}

      #{description}
    COMMIT
  end
end

#run_against(api) ⇒ Object



26
27
28
# File 'lib/dependabot/pull_request.rb', line 26

def run_against(api)
  api.create_pull_request(nwo, base, head, title, description)
end