Class: OmgPullRequest::Context

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

Instance Method Summary collapse

Instance Method Details

#add_animated_shas(issue_number, shas) ⇒ Object



15
16
17
# File 'lib/omg_pull_request/context.rb', line 15

def add_animated_shas(issue_number, shas)
  animated_shas[issue_number] = get_animated_shas(issue_number) + shas
end

#get_animated_shas(issue_number) ⇒ Object



11
12
13
# File 'lib/omg_pull_request/context.rb', line 11

def get_animated_shas(issue_number)
  animated_shas[issue_number] || []
end

#get_recently_closed(pull_requests) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/omg_pull_request/context.rb', line 19

def get_recently_closed(pull_requests)
  current_ids = pull_requests.collect { |a| a.number.to_s }
  closed  = (@active_pull_requests || Array.new) - current_ids
  @active_pull_requests = current_ids
  
  closed
end

#ran(request_sha) ⇒ Object



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

def ran(request_sha)
  ran_hash[request_sha] = true
end

#ran?(request_sha) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/omg_pull_request/context.rb', line 7

def ran?(request_sha)
  ran_hash[request_sha] == true
end