Class: LabClient::ApprovalRule

Inherits:
Klass show all
Includes:
ClassHelpers
Defined in:
lib/labclient/approvals/rule.rb

Overview

Inspect Helper

Instance Attribute Summary

Attributes inherited from Klass

#client, #response

Attributes inherited from LabStruct

#response

Instance Method Summary collapse

Methods included from ClassHelpers

#has?, #keys, #raw

Methods inherited from Klass

#api_methods, #collect_project_id, #collect_release_id, #collect_repository_id, date_time_attrs, #format_time?, #group_name, #help, #initialize, #klass, #success?, #to_json, #update_self, user_attrs, #valid_group_project_levels, #verbose

Methods included from Docs

#demo, #desc, #doc, docs, #example, #group_name, #help, json, #markdown, #navigation, #option, #result, #subtitle, #title

Methods included from CurlHelper

#curl

Methods inherited from LabStruct

#as_json, #client, #keys, #slice, #success?

Constructor Details

This class inherits a constructor from LabClient::Klass

Instance Method Details

#eligible_approversObject



12
13
14
15
16
# File 'lib/labclient/approvals/rule.rb', line 12

def eligible_approvers
  @table[:eligible_approvers].map do |user_data|
    User.new(user_data, response, client)
  end
end

#groupsObject



30
31
32
33
34
# File 'lib/labclient/approvals/rule.rb', line 30

def groups
  @table[:groups].map do |group_data|
    Group.new(group_data, response, client)
  end
end

#inspectObject



8
9
10
# File 'lib/labclient/approvals/rule.rb', line 8

def inspect
  "#<ApprovalRule id: #{id}, name: #{name}>"
end

#protected_branchesObject



18
19
20
21
22
# File 'lib/labclient/approvals/rule.rb', line 18

def protected_branches
  @table[:protected_branches].map do |branch_data|
    LabClient::Branch.new(branch_data, response, client)
  end
end

#usersObject



24
25
26
27
28
# File 'lib/labclient/approvals/rule.rb', line 24

def users
  @table[:users].map do |user_data|
    User.new(user_data, response, client)
  end
end