class Beryl::View
Attributes
state[RW]
Public Instance Methods
div(props = {}, &children)
click to toggle source
# File lib/beryl/view.rb, line 7 def div(props = {}, &children) node('div', props, children ? children.call : []) end
input(props = {}, &children)
click to toggle source
# File lib/beryl/view.rb, line 11 def input(props = {}, &children) node('input', props, children ? children.call : []) end
link(text, props = {}, &children)
click to toggle source
# File lib/beryl/view.rb, line 15 def link(text, props = {}, &children) node('a', props, [text(text)]) end
node(type, props = {}, children)
click to toggle source
# File lib/beryl/view.rb, line 19 def node(type, props = {}, children) { type: type, props: props, children: children } end
span(props = {}, &children)
click to toggle source
# File lib/beryl/view.rb, line 27 def span(props = {}, &children) node('span', props, children ? children.call : []) end
text(value, props = {}, &children)
click to toggle source
# File lib/beryl/view.rb, line 31 def text(value, props = {}, &children) node('text', props.merge(nodeValue: value), children ? children.call : []) end