Class: Riddler::Steps::Content
- Inherits:
-
Riddler::Step
- Object
- Riddler::Step
- Riddler::Steps::Content
- Defined in:
- lib/riddler/steps/content.rb
Instance Attribute Summary
Attributes inherited from Riddler::Step
#context, #definition, #preview_enabled
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Riddler::Step
for, inherited, #initialize, subclasses
Methods included from Includeable
Constructor Details
This class inherits a constructor from Riddler::Step
Class Method Details
.type ⇒ Object
4 5 6 |
# File 'lib/riddler/steps/content.rb', line 4 def self.type "content" end |
Instance Method Details
#elements ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/riddler/steps/content.rb', line 8 def elements @elements ||= definition["elements"] .map do |element_definition| ::Riddler::Element.for element_definition, context end .select(&:include?) end |
#to_hash ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/riddler/steps/content.rb', line 16 def to_hash hash = super hash["elements"] = elements.map do |element| element.to_hash end hash end |