Class: OctoMerge::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/octo_merge/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(working_directory:, repo:, pull_request_numbers:) ⇒ Context

Returns a new instance of Context.



5
6
7
8
9
# File 'lib/octo_merge/context.rb', line 5

def initialize(working_directory:, repo:, pull_request_numbers:)
  @working_directory = working_directory
  @repo = repo
  @pull_request_numbers = pull_request_numbers
end

Instance Attribute Details

#repoObject (readonly)

Returns the value of attribute repo.



3
4
5
# File 'lib/octo_merge/context.rb', line 3

def repo
  @repo
end

#working_directoryObject (readonly)

Returns the value of attribute working_directory.



3
4
5
# File 'lib/octo_merge/context.rb', line 3

def working_directory
  @working_directory
end

Instance Method Details

#pull_requestsObject



11
12
13
14
15
# File 'lib/octo_merge/context.rb', line 11

def pull_requests
  @pull_requests ||= pull_request_numbers.map do |number|
    PullRequest.new(repo: repo, number: number.to_s)
  end
end