module Essay::SerializeHelper

Public Instance Methods

serialize_steps() click to toggle source
# File lib/essay/helpers/serialize_helper.rb, line 27
def serialize_steps
  self.class.serialize_steps
end
to_hash() click to toggle source
# File lib/essay/helpers/serialize_helper.rb, line 18
def to_hash
  serialize_steps.each_with_object({}) do |step, result|
    condition = step.fetch(:options)[:if]
    if !condition || try(condition)
      result.merge!(instance_exec(&step.fetch(:block)))
    end
  end
end