Sha256: 977f53162909809addce3182d26582a4e31fae80f10665b7f12a8162eb39caf4
Contents?: true
Size: 754 Bytes
Versions: 16
Compression:
Stored size: 754 Bytes
Contents
class Card class Format module Nest module Subformat def subformat subcard subcard = Card.fetch(subcard, new: {}) unless subcard.is_a?(Card) self.class.new subcard, parent: self, format_class: self.class, form: @form end def root @root ||= parent ? parent.root : self end def depth @depth ||= parent ? (parent.depth + 1) : 0 end def main? depth.zero? end def focal? # meaning the current card is the requested card depth.zero? end def field_subformat field field = card.name.field(field) unless field.is_a?(Card) subformat field end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems