Class: Riddler::Elements::Varient
Instance Attribute Summary
#context, #definition
Class Method Summary
collapse
Instance Method Summary
collapse
for, inherited, #initialize, subclasses
#include?, #include_predicate
Class Method Details
.type ⇒ Object
4
5
6
|
# File 'lib/riddler/elements/variant.rb', line 4
def self.type
"variant"
end
|
Instance Method Details
#included_element ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/riddler/elements/variant.rb', line 12
def included_element
definition["elements"]
.map do |hash|
::Riddler::Element.for hash, context
end
.detect(&:include?)
end
|
#to_hash ⇒ Object
8
9
10
|
# File 'lib/riddler/elements/variant.rb', line 8
def to_hash
included_element.to_hash
end
|