Class: Card::Set::Rule::RuleForm::RuleSetRadio

Inherits:
Object
  • Object
show all
Defined in:
card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/rule_set_radio.rb,
card/tmpsets/set/mod037-card-mod-rules/rule/rule_form/rule_set_radio.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format, set_name, tag, state) ⇒ RuleSetRadio

Returns a new instance of RuleSetRadio.

Parameters:

  • state (:current, :overwritten)


14
15
16
17
18
19
20
# File 'card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/rule_set_radio.rb', line 14

def initialize format, set_name, tag, state
  @format = format
  @card = format.card
  @set_name = set_name
  @tag = tag
  @state = state
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



9
10
11
# File 'card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/rule_set_radio.rb', line 9

def format
  @format
end

Instance Method Details

#html(narrower) ⇒ Object



22
23
24
25
26
27
28
29
# File 'card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/rule_set_radio.rb', line 22

def html narrower
  @narrower_rules = narrower

  rule_radio do
    radio_text = "#{@set_name}+#{@tag}"
    radio_button :name, radio_text, checked: false, warning: warning
  end
end