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

Inherits:
Object
  • Object
show all
Defined in:
tmpsets/set/mod022-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 'tmpsets/set/mod022-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 'tmpsets/set/mod022-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 'tmpsets/set/mod022-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: checked?, warning: warning
  end
end