Class: Riddler::Steps::Variant
Instance Attribute Summary
#context, #definition, #preview_enabled
Class Method Summary
collapse
Instance Method Summary
collapse
for, inherited, #initialize, subclasses
#include?, #include_predicate
Constructor Details
This class inherits a constructor from Riddler::Step
Class Method Details
.type ⇒ Object
4
5
6
|
# File 'lib/riddler/steps/variant.rb', line 4
def self.type
"variant"
end
|
Instance Method Details
#included_step ⇒ Object
14
15
16
|
# File 'lib/riddler/steps/variant.rb', line 14
def included_step
steps.detect &:include?
end
|
#steps ⇒ Object
8
9
10
11
12
|
# File 'lib/riddler/steps/variant.rb', line 8
def steps
@steps ||= definition["steps"].map do |hash|
::Riddler::Step.for hash, context
end
end
|
#to_hash ⇒ Object
18
19
20
|
# File 'lib/riddler/steps/variant.rb', line 18
def to_hash
included_step&.to_hash
end
|