Class: Ghee::API::Repos::Pulls::Proxy

Inherits:
ResourceProxy show all
Includes:
CUD
Defined in:
lib/ghee/api/pulls.rb

Instance Attribute Summary

Attributes inherited from ResourceProxy

#connection, #current_page, #id, #pagination, #params, #path_prefix, #total

Instance Method Summary collapse

Methods included from CUD

#create, #destroy, #patch

Methods inherited from ResourceProxy

accept_header, #all, #all_parallel, #build_prefix, #initialize, #method_missing, #paginate, #raw, #subject

Constructor Details

This class inherits a constructor from Ghee::ResourceProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ghee::ResourceProxy

Instance Method Details

#commitsObject



17
18
19
# File 'lib/ghee/api/pulls.rb', line 17

def commits
  connection.get("#{path_prefix}/commits").body
end

#filesObject



21
22
23
# File 'lib/ghee/api/pulls.rb', line 21

def files
  connection.get("#{path_prefix}/files").body
end

#merge!(message = nil) ⇒ Object



29
30
31
32
# File 'lib/ghee/api/pulls.rb', line 29

def merge!(message=nil)
  params = message ? {:commit_message=>message} : {}
  connection.put("#{path_prefix}/merge", params).body
end

#merge?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ghee/api/pulls.rb', line 25

def merge?
  connection.get("#{path_prefix}/merge").status == 204
end