Class: OctoMerge::Execute

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context:, strategy:) ⇒ Execute

Returns a new instance of Execute.



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

def initialize(context:, strategy:)
  @context = context
  @strategy = strategy
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end

#strategyObject (readonly)

Returns the value of attribute strategy.



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

def strategy
  @strategy
end

Instance Method Details

#envObject



14
15
16
17
18
19
# File 'lib/octo_merge/execute.rb', line 14

def env
  @env ||= strategy.new(
    working_directory: context.working_directory,
    pull_requests: context.pull_requests
  )
end

#runObject



10
11
12
# File 'lib/octo_merge/execute.rb', line 10

def run
  env.run
end