Sha256: a35f2e1bd0dd44e511a61fd94c682aec2e31706a28fda25a85aff253ae5a9a38

Contents?: true

Size: 803 Bytes

Versions: 14

Compression:

Stored size: 803 Bytes

Contents

module Voom
  module Presenters
    module DSL
      module Components
        class Snackbar < Base
          attr_accessor :text

          def initialize(**attribs_, &block)
            super(type: :snackbar, **attribs_, &block)
            @text = attribs.delete(:text)
            expand!
          end

          def action(text=nil, **params, &block)
            return @action if locked?
            @action = Action.new(parent: self, text: text, context: params, &block)
          end

          class Action < EventBase
            attr_accessor :text

            def initialize(**attribs_, &block)
              super(type: :snackbar, **attribs_, &block)
              @text = attribs.delete(:text)
              expand!
            end
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
voom-presenters-0.1.13 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.12 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.11 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.10 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.9 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.8 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.7 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.6 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.5 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.4 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.3 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.2 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.1 lib/voom/presenters/dsl/components/snackbar.rb
voom-presenters-0.1.0 lib/voom/presenters/dsl/components/snackbar.rb