Class: Content::ContentViewFactory
- Inherits:
-
Object
- Object
- Content::ContentViewFactory
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- app/services/content/content_view_factory.rb
Instance Attribute Summary collapse
-
#originator_id ⇒ Object
Returns the value of attribute originator_id.
-
#originator_type ⇒ Object
Returns the value of attribute originator_type.
-
#os_cv ⇒ Object
Returns the value of attribute os_cv.
-
#parent_cv ⇒ Object
Returns the value of attribute parent_cv.
-
#product_cv ⇒ Object
Returns the value of attribute product_cv.
-
#source_repositories ⇒ Object
Returns the value of attribute source_repositories.
Instance Method Summary collapse
- #content_view ⇒ Object
-
#initialize(attributes = {}) ⇒ ContentViewFactory
constructor
A new instance of ContentViewFactory.
- #persisted? ⇒ Boolean
- #repositories ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ ContentViewFactory
Returns a new instance of ContentViewFactory.
10 11 12 13 14 |
# File 'app/services/content/content_view_factory.rb', line 10 def initialize(attributes = {}) attributes.each do |name, value| instance_variable_set("@#{name}", value) if respond_to?("#{name}".to_sym) end end |
Instance Attribute Details
#originator_id ⇒ Object
Returns the value of attribute originator_id.
7 8 9 |
# File 'app/services/content/content_view_factory.rb', line 7 def originator_id @originator_id end |
#originator_type ⇒ Object
Returns the value of attribute originator_type.
7 8 9 |
# File 'app/services/content/content_view_factory.rb', line 7 def originator_type @originator_type end |
#os_cv ⇒ Object
Returns the value of attribute os_cv.
7 8 9 |
# File 'app/services/content/content_view_factory.rb', line 7 def os_cv @os_cv end |
#parent_cv ⇒ Object
Returns the value of attribute parent_cv.
7 8 9 |
# File 'app/services/content/content_view_factory.rb', line 7 def parent_cv @parent_cv end |
#product_cv ⇒ Object
Returns the value of attribute product_cv.
7 8 9 |
# File 'app/services/content/content_view_factory.rb', line 7 def product_cv @product_cv end |
#source_repositories ⇒ Object
Returns the value of attribute source_repositories.
7 8 9 |
# File 'app/services/content/content_view_factory.rb', line 7 def source_repositories @source_repositories end |
Instance Method Details
#content_view ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/services/content/content_view_factory.rb', line 20 def content_view case originator_type when 'Hostgroup' create_composite_content_view else ContentView.new(:repository_ids_to_clone => originator.repositories, :originator => originator) end end |
#persisted? ⇒ Boolean
16 17 18 |
# File 'app/services/content/content_view_factory.rb', line 16 def persisted? false end |
#repositories ⇒ Object
29 30 31 |
# File 'app/services/content/content_view_factory.rb', line 29 def repositories originator.repositories end |