Module: Card::Set::Abstract::Pointer::OptionsApi::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod009-card-mod-list/abstract/01_pointer/options_api.rb,
card/tmpsets/set/mod008-card-mod-list/abstract/01_pointer/options_api.rb

Instance Method Summary collapse

Instance Method Details

#option_label(option_name, id) ⇒ Object



72
73
74
# File 'card/tmpsets/set/mod009-card-mod-list/abstract/01_pointer/options_api.rb', line 72

def option_label option_name, id
  %(<label for="#{id}">#{option_label_text option_name}</label>)
end

#option_label_text(option_name) ⇒ Object



80
81
82
83
84
# File 'card/tmpsets/set/mod009-card-mod-list/abstract/01_pointer/options_api.rb', line 80

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



76
77
78
# File 'card/tmpsets/set/mod009-card-mod-list/abstract/01_pointer/options_api.rb', line 76

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