Class: KalibroGem::Entities::Repository
- Defined in:
- lib/kalibro_gem/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, #errors=, #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 KalibroGem::Entities::Model
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
23 24 25 |
# File 'lib/kalibro_gem/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_gem/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_gem/entities/repository.rb', line 23 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/kalibro_gem/entities/repository.rb', line 23 def id @id end |
#license ⇒ Object
Returns the value of attribute license.
23 24 25 |
# File 'lib/kalibro_gem/entities/repository.rb', line 23 def license @license end |
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/kalibro_gem/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_gem/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_gem/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_gem/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_gem/entities/repository.rb', line 23 def type @type end |
Class Method Details
.all ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/kalibro_gem/entities/repository.rb', line 54 def self.all projects = Project.all repositories = [] projects.each do |project| repositories.concat(repositories_of(project.id)) end return repositories end |
.exists?(id) ⇒ Boolean
71 72 73 74 75 76 77 |
# File 'lib/kalibro_gem/entities/repository.rb', line 71 def self.exists?(id) begin return true unless find(id).nil? rescue KalibroGem::Errors::RecordNotFound return false end end |
.find(id) ⇒ Object
65 66 67 68 69 |
# File 'lib/kalibro_gem/entities/repository.rb', line 65 def self.find(id) all.each { |repository| return repository if repository.id == id } raise KalibroGem::Errors::RecordNotFound end |
.repositories_of(project_id) ⇒ Object
29 30 31 32 |
# File 'lib/kalibro_gem/entities/repository.rb', line 29 def self.repositories_of(project_id) repositories = create_objects_array_from_hash request(:repositories_of, {:project_id => project_id})[:repository] repositories.map { |repository| repository.project_id = project_id; repository } end |
.repository_types ⇒ Object
25 26 27 |
# File 'lib/kalibro_gem/entities/repository.rb', line 25 def self.repository_types request(:supported_repository_types)[:supported_type].to_a end |
Instance Method Details
#cancel_processing_of_repository ⇒ Object
50 51 52 |
# File 'lib/kalibro_gem/entities/repository.rb', line 50 def cancel_processing_of_repository self.class.request(:cancel_processing_of_repository, {:repository_id => self.id}) end |
#process ⇒ Object
46 47 48 |
# File 'lib/kalibro_gem/entities/repository.rb', line 46 def process self.class.request(:process_repository, {:repository_id => self.id}) end |