Sha256: d83e430ec753fde482e52aa3e4075ee10f19b1427dd3fe5651d10455551ecacb

Contents?: true

Size: 520 Bytes

Versions: 1

Compression:

Stored size: 520 Bytes

Contents

class Slacken::DocumentComponent
  module StringfyCheckbox
    # Private: Reject blank elements
    def stringfy_checkbox
      if type.member_of?(:input) && attrs[:type] == 'checkbox'
        self.class.new(:checkbox, [], checked: attrs[:checked])
      else
        derive(children.map(&:stringfy_checkbox))
      end
    end

    def checkbox_stringfied?
      if type.member_of?(:input) && attrs[:type] == 'checkbox'
        false
      else
        children.all?(&:checkbox_stringfied?)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slacken-0.1.0 lib/slacken/document_component/stringfy_checkbox.rb