module Bluesky::DSL

Public Instance Methods

tag(tag_name, attributes=nil, content=nil, &block) click to toggle source
# File lib/bluesky/dsl.rb, line 22
def tag(tag_name, attributes=nil, content=nil, &block)

  if block
    attributes ||= {}
    content ||= []
    block.call(NodeBuilder.new(tag_name, attributes, content))
  end

  Clearwater::VirtualDOM.node(
    tag_name,
    Clearwater::Component.sanitize_attributes(attributes),
    Clearwater::Component.sanitize_content(content)
  )

end