Class: HubLink::Api::Review

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/hub_link/api/review.rb

Constant Summary collapse

BOTS =
%w(houndci-bot cookpad-devel)

Instance Method Summary collapse

Instance Method Details

#approval?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/hub_link/api/review.rb', line 10

def approval?
  state == "APPROVED"
end

#invalid?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/hub_link/api/review.rb', line 14

def invalid?
  bot? || driveby? || draft?
end

#reviewerObject



6
7
8
# File 'lib/hub_link/api/review.rb', line 6

def reviewer
  user&.
end

#to_hObject



18
19
20
# File 'lib/hub_link/api/review.rb', line 18

def to_h
  Slicer.new(self, columns: %i(id pull_request_id submitted_at reviewer approval?)).to_h
end