Sha256: 21fac2e6538cf1cb790216a6509f6507d9bb8ee764a0665667b678dada6f3f16
Contents?: true
Size: 1.19 KB
Versions: 13
Compression:
Stored size: 1.19 KB
Contents
class Card class Format module Nesting # Handle the main nest module Main def wrap_main yield # no wrapping in base format end def main_nest opts wrap_main do with_nest_mode :normal do nest root.card, opts.merge(main_view: true, main: true) end end end def main_nest? nest_name nest_name == "_main" && !root.already_mained? end def already_mained? return true if @main || @already_main @already_main = true false end def main! @main = true end def main_nest_options opts = root.main_opts || {} main_nest_size_opt opts main_nest_items_opt opts opts end protected def main_nest_size_opt opts val = params[:size] return unless val.present? opts[:size] = val.to_sym end def main_nest_items_opt opts val = params[:item] return unless val.present? opts[:items] ||= {} opts[:items][:view] = val.to_sym end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems