class Riddler::Steps::Content

Public Class Methods

type() click to toggle source
# File lib/riddler/steps/content.rb, line 4
def self.type
  "content"
end

Public Instance Methods

elements() click to toggle source
# 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() click to toggle source
Calls superclass method Riddler::Step#to_hash
# 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