Class: Katello::RepositoryType::ContentType

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

Direct Known Subclasses

GenericContentType

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ContentType

Returns a new instance of ContentType.



147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'app/services/katello/repository_type.rb', line 147

def initialize(options)
  self.model_class = options[:model_class]
  self.content_type = options[:content_type]
  self.priority = options[:priority] || 99
  self.pulp3_service_class = options[:pulp3_service_class]
  self.index = options[:index].nil? ? true : options[:index]
  self.uploadable = options[:uploadable] || false
  self.removable = options[:removable] || false
  self.primary_content = options[:primary_content] || false
  self.generic_browser = options[:generic_browser]
  self.repository_import_on_upload = options[:repository_import_on_upload]
  self.test_upload_path = options[:test_upload_path]
  self.mutable = options.fetch(:mutable, false)
end

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def content_type
  @content_type
end

#generic_browserObject

Returns the value of attribute generic_browser.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def generic_browser
  @generic_browser
end

#indexObject

Returns the value of attribute index.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def index
  @index
end

#model_classObject

Returns the value of attribute model_class.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def model_class
  @model_class
end

#mutableObject

Returns the value of attribute mutable.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def mutable
  @mutable
end

#primary_contentObject

Returns the value of attribute primary_content.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def primary_content
  @primary_content
end

#priorityObject

Returns the value of attribute priority.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def priority
  @priority
end

#pulp3_service_classObject

Returns the value of attribute pulp3_service_class.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def pulp3_service_class
  @pulp3_service_class
end

#removableObject

Returns the value of attribute removable.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def removable
  @removable
end

#repository_import_on_uploadObject

Returns the value of attribute repository_import_on_upload.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def repository_import_on_upload
  @repository_import_on_upload
end

#test_upload_pathObject

Returns the value of attribute test_upload_path.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def test_upload_path
  @test_upload_path
end

#uploadableObject

Returns the value of attribute uploadable.



143
144
145
# File 'app/services/katello/repository_type.rb', line 143

def uploadable
  @uploadable
end

Instance Method Details

#as_json(_options = {}) ⇒ Object



166
167
168
169
170
171
172
173
174
175
# File 'app/services/katello/repository_type.rb', line 166

def as_json(_options = {})
  {
    label: label,
    generic_browser: generic_browser,
    generic: false,
    removable: removable,
    uploadable: uploadable,
    indexed: index
  }
end

#generic?Boolean

Returns:

  • (Boolean)


177
178
179
# File 'app/services/katello/repository_type.rb', line 177

def generic?
  false
end

#labelObject



162
163
164
# File 'app/services/katello/repository_type.rb', line 162

def label
  self.model_class::CONTENT_TYPE
end