Class: Playbook::PbCheckbox::Checkbox

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers::FormTagHelper, Playbook::Props
Defined in:
app/pb_kits/playbook/pb_checkbox/checkbox.rb

Instance Method Summary collapse

Methods included from Playbook::Props

#dark_props, #generate_classname, #generate_classname_without_spacing, #initialize, #prop, #spacing_options, #spacing_props, #spacing_values

Instance Method Details

#checkbox_label_statusObject



37
38
39
# File 'app/pb_kits/playbook/pb_checkbox/checkbox.rb', line 37

def checkbox_label_status
  error ? "negative" : nil
end

#checked_htmlObject



25
26
27
# File 'app/pb_kits/playbook/pb_checkbox/checkbox.rb', line 25

def checked_html
  checked ? "checked='true'" : nil
end

#classnameObject



29
30
31
# File 'app/pb_kits/playbook/pb_checkbox/checkbox.rb', line 29

def classname
  generate_classname("pb_checkbox_kit", checked_class) + error_class
end

#inputObject



33
34
35
# File 'app/pb_kits/playbook/pb_checkbox/checkbox.rb', line 33

def input
  check_box_tag(name, value, checked, input_options)
end