Class: Katello::ContentViewVersionComparePresenter
- Inherits:
-
Object
- Object
- Katello::ContentViewVersionComparePresenter
show all
- Defined in:
- app/presenters/katello/content_view_version_compare_presenter.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ContentViewVersionComparePresenter.
3
4
5
6
7
|
# File 'app/presenters/katello/content_view_version_compare_presenter.rb', line 3
def initialize(content_item, content_view_versions, repository)
@item = content_item
@versions = content_view_versions
@repository = repository
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
19
20
21
|
# File 'app/presenters/katello/content_view_version_compare_presenter.rb', line 19
def method_missing(*args, &block)
@item.send(*args, &block)
end
|
Instance Method Details
#comparison ⇒ Object
9
10
11
12
13
|
# File 'app/presenters/katello/content_view_version_compare_presenter.rb', line 9
def comparison
item_repos = @item.repositories
item_repos.where(:library_instance_id => @repository.id) if @repository
item_repos.map(&:content_view_version_id) & @versions.map(&:id)
end
|
#respond_to?(method) ⇒ Boolean
15
16
17
|
# File 'app/presenters/katello/content_view_version_compare_presenter.rb', line 15
def respond_to?(method)
return method.to_s == 'comparison' || @item.respond_to?(method)
end
|