Sha256: 9019c14604dec1e7161f931b5260211641a11f1c481b798de8af07904888c05b
Contents?: true
Size: 768 Bytes
Versions: 13
Compression:
Stored size: 768 Bytes
Contents
class Card module Env # slot-related environmental variable handling module SlotOptions def slot_opts # FIXME: upgrade to safe parameters @slot_opts ||= interpret_slot_options end private def interpret_slot_options opts = hash params[:slot] opts.merge! shortcut_slot_opts opts.deep_symbolize_keys.slice(*Card::View::Options.slot_keys) end def shortcut_slot_opts opts = {} opts[:size] = params[:size].to_sym if params[:size] opts[:items] = { view: params[:item].to_sym } if slot_items_shortcut? opts end def slot_items_shortcut? params[:item].present? && !params.dig(:slot, :items, :view).present? end end end end
Version data entries
13 entries across 13 versions & 1 rubygems