Class: Nucleo::Models::Elements
- Inherits:
-
Object
- Object
- Nucleo::Models::Elements
- Includes:
- Enumerable
- Defined in:
- lib/nucleo/models/elements.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #find_content ⇒ Object
- #find_image_src ⇒ Object
-
#initialize(collection) ⇒ Nucleo::Models::Changes
constructor
Return an instance of the Rules collection domain model.
Constructor Details
#initialize(collection) ⇒ Nucleo::Models::Changes
Return an instance of the Rules collection domain model
11 12 13 |
# File 'lib/nucleo/models/elements.rb', line 11 def initialize(collection) @collection = Array(collection) end |
Instance Method Details
#each(&block) ⇒ Object
15 16 17 |
# File 'lib/nucleo/models/elements.rb', line 15 def each(&block) internal_collection.each(&block) end |
#find_content ⇒ Object
19 20 21 |
# File 'lib/nucleo/models/elements.rb', line 19 def find_content self.collect { |r| r.content if r.content_present? } end |
#find_image_src ⇒ Object
23 24 25 |
# File 'lib/nucleo/models/elements.rb', line 23 def find_image_src self.collect { |r| r.image_src if r.image? } end |