class Voom::Presenters::DSL::Components::Dialog
Attributes
components[RW]
percent_height[RW]
percent_width[RW]
px_height[RW]
px_width[RW]
shows_errors[RW]
Public Class Methods
new(**attribs_, &block)
click to toggle source
Calls superclass method
# File lib/voom/presenters/dsl/components/dialog.rb, line 21 def initialize(**attribs_, &block) super(type: :dialog, **attribs_, &block) width = attribs.delete(:width) height = attribs.delete(:height) @percent_width = width&.end_with?("%") ? width : nil @percent_height = height&.end_with?("%") ? height : nil @px_width = !width&.end_with?("%") ? width : nil @px_height = !height&.end_with?("%") ? height : nil @shows_errors = attribs.delete(:shows_errors){true} @buttons = [] @components=[] expand! end
Public Instance Methods
actions(**attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/dialog.rb, line 55 def actions(**attribs, &block) return @actions if locked? @actions = Actions.new(parent: self, **attribs, &block) end
body(*text, **options, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/dialog.rb, line 49 def body(*text, **options, &block) components << Components::Typography.new(parent: self, type: :body, text: text, **options, &block) end
heading(*text, **options, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/dialog.rb, line 43 def heading(*text, **options, &block) components << Components::Typography.new(parent: self, type: :heading, text: text, **options, &block) end
title(*title, **options, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/dialog.rb, line 36 def title(*title, **options, &block) return @title if locked? @title = Components::Typography.new(parent: self, type: :title, text: title, **options, &block) end