change views to use objects instead of yaml

This commit is contained in:
2022-12-02 11:10:38 +02:00
parent 4f6538e135
commit 48cfcb592d
14 changed files with 55 additions and 42 deletions

View File

@ -31,6 +31,25 @@ module Merged
end
end
[:button_link , :button_text ].each do |meth|
define_method(meth) do
@content["options"][meth.to_s]
end
end
def has_option?(option)
options.has_key?(option)
end
def options
@content["options"] || {}
end
def set_option( option , value)
@content["options"] = {} if @content["options"].nil?
options[option] = value
end
def cards?
! cards.empty?
end