Class: Katello::RepositoryPresenter
- Inherits:
-
Object
- Object
- Katello::RepositoryPresenter
- Defined in:
- app/presenters/katello/repository_presenter.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
- #content_view_environments ⇒ Object
-
#initialize(repository) ⇒ RepositoryPresenter
constructor
A new instance of RepositoryPresenter.
Constructor Details
#initialize(repository) ⇒ RepositoryPresenter
Returns a new instance of RepositoryPresenter.
5 6 7 |
# File 'app/presenters/katello/repository_presenter.rb', line 5 def initialize(repository) @repository = repository end |
Instance Attribute Details
#repository ⇒ Object
Returns the value of attribute repository.
3 4 5 |
# File 'app/presenters/katello/repository_presenter.rb', line 3 def repository @repository end |
Instance Method Details
#content_view_environments ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/presenters/katello/repository_presenter.rb', line 9 def content_view_environments unarchived = @repository.clones.select { |clone| clone.environment && clone.content_view_version } unarchived.collect do |repository| if repository.environment && repository.content_view_version { :content_view_version => { :id => repository.content_view_version.id, :name => repository.content_view_version.name }, :environment => { :id => repository.environment.id, :name => repository.environment.name } } end end end |