lib/pagebuilder/elements/basic.rb
# Helper to easily set the content and attributes for this element
# @param content [String] text for the content of the element
# @param attributes [] keyword arguments for the attributes that should be set
# @option data [Hash] data attributes that should be set
# @return [self]
Helper to easily set the content and attributes for this element
Helper to easily set the content and attributes for this element
def configure(content = nil, **attributes)
        self.content = content if content
        data_attrs = attributes.delete(:data)
        self.data_attributes = data_attrs if data_attrs
        attributes.each { |k, v| self[k] = v }
        self
      end
def configure ( content = nil , ** attributes ) self . content = content if content data_attrs = attributes . delete ( :data ) self . data_attributes = data_attrs if data_attrs attributes . each { | k , v | self [ k ] = v } self end
Helper to easily set the content and attributes for this element
Helper to easily set the content and attributes for this element
# Deal with helper attributes # Set normal attributes
None
self
content
text for the content of the element
text for the content of the element
attributes
keyword arguments for the attributes that should be set
keyword arguments for the attributes that should be set
data
<not_specific>
data attributes that should be set
data attributes that should be set