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

Inherits:
Object
  • Object
show all
Defined in:
platypus/tmp/set/gem-defaults/mod010-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)


15
16
17
18
19
20
21
22
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/rule_form/rule_set_radio.rb', line 15

def initialize format, set_name, tag, state
  @format = format
  @card = format.card
  @set_name = set_name
  @tag = tag
  @state = state
  @id = "#{unique_id}-#{Time.now.to_i}"
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



9
10
11
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/rule_form/rule_set_radio.rb', line 9

def format
  @format
end

Instance Method Details

#html(narrower) ⇒ Object



24
25
26
27
28
29
30
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/rule_form/rule_set_radio.rb', line 24

def html narrower
  @narrower_rules = narrower

  wrap_with :div, class: "form-check" do
    [radio, label]
  end
end