Class: KalibroGatekeeperClient::Entities::Repository
- Defined in:
- lib/kalibro_gatekeeper_client/entities/repository.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#configuration_id ⇒ Object
Returns the value of attribute configuration_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#license ⇒ Object
Returns the value of attribute license.
-
#name ⇒ Object
Returns the value of attribute name.
-
#process_period ⇒ Object
Returns the value of attribute process_period.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#send_email ⇒ Object
Returns the value of attribute send_email.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Model
Class Method Summary collapse
- .all ⇒ Object
- .exists?(id) ⇒ Boolean
- .find(id) ⇒ Object
- .repositories_of(project_id) ⇒ Object
- .repository_types ⇒ Object
Instance Method Summary collapse
Methods inherited from Model
#==, create, create_array_from_hash, create_objects_array_from_hash, #destroy, #initialize, request, #save, #save!, #to_hash, to_object, to_objects_array
Methods included from RequestMethods::ClassMethods
#exists_action, #find_action, #id_params
Methods included from HashConverters
#convert_to_hash, #date_with_milliseconds, #field_to_hash
Methods included from XMLConverters
#get_xml, #xml_instance_class_name
Methods included from RequestMethods
#destroy_action, #destroy_params, #save_action
Constructor Details
This class inherits a constructor from KalibroGatekeeperClient::Entities::Model
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def address @address end |
#configuration_id ⇒ Object
Returns the value of attribute configuration_id.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def configuration_id @configuration_id end |
#description ⇒ Object
Returns the value of attribute description.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def id @id end |
#license ⇒ Object
Returns the value of attribute license.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def license @license end |
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def name @name end |
#process_period ⇒ Object
Returns the value of attribute process_period.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def process_period @process_period end |
#project_id ⇒ Object
Returns the value of attribute project_id.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def project_id @project_id end |
#send_email ⇒ Object
Returns the value of attribute send_email.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def send_email @send_email end |
#type ⇒ Object
Returns the value of attribute type.
23 24 25 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 23 def type @type end |
Class Method Details
.all ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 57 def self.all projects = Project.all repositories = [] projects.each do |project| repositories.concat(repositories_of(project.id)) end return repositories end |
.exists?(id) ⇒ Boolean
74 75 76 77 78 79 80 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 74 def self.exists?(id) begin return true unless find(id).nil? rescue KalibroGatekeeperClient::Errors::RecordNotFound return false end end |
.find(id) ⇒ Object
68 69 70 71 72 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 68 def self.find(id) all.each { |repository| return repository if repository.id == id } raise KalibroGatekeeperClient::Errors::RecordNotFound end |
.repositories_of(project_id) ⇒ Object
29 30 31 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 29 def self.repositories_of(project_id) repositories = create_objects_array_from_hash request('of', {project_id: project_id})['repositories'] end |
.repository_types ⇒ Object
25 26 27 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 25 def self.repository_types request('supported_types', {}, :get)['supported_types'].to_a end |
Instance Method Details
#cancel_processing_of_repository ⇒ Object
53 54 55 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 53 def cancel_processing_of_repository self.class.request('cancel_process', {id: self.id}) end |
#process ⇒ Object
49 50 51 |
# File 'lib/kalibro_gatekeeper_client/entities/repository.rb', line 49 def process self.class.request('process', {id: self.id}) end |