Module: Card::Set::Abstract::Items::OptionsApi::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod031-layout/abstract/items/options_api.rb

Instance Method Summary collapse

Instance Method Details

#option_label(option_name, id) ⇒ Object



77
78
79
80
81
# File 'platypus/tmp/set/gem-defaults/mod031-layout/abstract/items/options_api.rb', line 77

def option_label option_name, id
  wrap_with :label, class: "form-check-label", for: id do
    option_label_text option_name
  end
end

#option_label_text(option_name) ⇒ Object



87
88
89
90
91
# File 'platypus/tmp/set/gem-defaults/mod031-layout/abstract/items/options_api.rb', line 87

def option_label_text option_name
  return option_name unless (option_card = Card.fetch option_name)

  nest option_card, view: option_view
end

#option_viewObject



83
84
85
# File 'platypus/tmp/set/gem-defaults/mod031-layout/abstract/items/options_api.rb', line 83

def option_view
  @option_view ||= card.rule(:content_option_view) || :smart_label
end