Class: Katello::RepositoryType::GenericContentType

Inherits:
ContentType
  • Object
show all
Defined in:
app/services/katello/repository_type.rb

Instance Attribute Summary collapse

Attributes inherited from ContentType

#content_type, #generic_browser, #index, #model_class, #mutable, #primary_content, #priority, #pulp3_service_class, #removable, #repository_import_on_upload, #test_upload_path, #uploadable

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ GenericContentType

Returns a new instance of GenericContentType.



186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'app/services/katello/repository_type.rb', line 186

def initialize(options)
  super
  self.pulp3_api = options[:pulp3_api]
  self.pulp3_model = options[:pulp3_model]
  self.content_type = options[:content_type]
  self.filename_key = options[:filename_key]
  self.duplicates_allowed = options[:duplicates_allowed]
  self.pluralized_name = options[:pluralized_name]
  self.model_name = options[:model_name]
  self.model_version = options[:model_version]
  self.model_filename = options[:model_filename]
  self. = options[:model_additional_metadata]
end

Instance Attribute Details

#duplicates_allowedObject

Returns the value of attribute duplicates_allowed.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def duplicates_allowed
  @duplicates_allowed
end

#filename_keyObject

Returns the value of attribute filename_key.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def filename_key
  @filename_key
end

#model_additional_metadataObject

Returns the value of attribute model_additional_metadata.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def 
  @model_additional_metadata
end

#model_filenameObject

Returns the value of attribute model_filename.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def model_filename
  @model_filename
end

#model_nameObject

Returns the value of attribute model_name.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def model_name
  @model_name
end

#model_versionObject

Returns the value of attribute model_version.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def model_version
  @model_version
end

#pluralized_nameObject

Returns the value of attribute pluralized_name.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def pluralized_name
  @pluralized_name
end

#pulp3_apiObject

Returns the value of attribute pulp3_api.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def pulp3_api
  @pulp3_api
end

#pulp3_modelObject

Returns the value of attribute pulp3_model.



183
184
185
# File 'app/services/katello/repository_type.rb', line 183

def pulp3_model
  @pulp3_model
end

Instance Method Details

#as_json(_options = {}) ⇒ Object



216
217
218
219
220
221
222
223
224
225
# File 'app/services/katello/repository_type.rb', line 216

def as_json(_options = {})
  super.merge(
    {
      :generic => true,
      :pluralized_label => content_type.pluralize,
      :pluralized_name => pluralized_name,
      :details_columns => details_columns
    }
  )
end

#details_columnsObject



208
209
210
211
212
213
214
# File 'app/services/katello/repository_type.rb', line 208

def details_columns
  columns = []
  columns << "Name" if self.model_name
  columns << "Version" if self.model_version
  columns << "Filename" if self.model_filename
  columns
end

#generic?Boolean

Returns:

  • (Boolean)


204
205
206
# File 'app/services/katello/repository_type.rb', line 204

def generic?
  true
end

#labelObject



200
201
202
# File 'app/services/katello/repository_type.rb', line 200

def label
  self.content_type
end