Sha256: 2e2547165c645e2a25d5472f1ae6bd7924f378b1f4a04618bbc16be8d93c59eb

Contents?: true

Size: 1.25 KB

Versions: 21

Compression:

Stored size: 1.25 KB

Contents

module UiBibz::Helpers::Ui::Core::NotificationsHelper

  # Alert Component
  #
  # +options+ (Hash)
  # +html_options+ (Hash)
  #
  def ui_alert content = nil, options = nil, html_options = nil, &block
    if is_tap(content, options)
      UiBibz::Ui::Core::Notifications::Alert.new(content, options, html_options).tap(&block).render
    else
      UiBibz::Ui::Core::Notifications::Alert.new(content, options, html_options, &block).render
    end
  end

  # Badge (Label) Component
  #
  # +options+ (Hash)
  # +html_options+ (Hash)
  #
  def ui_badge content = nil, options = nil, html_options = nil, &block
    UiBibz::Ui::Core::Notifications::Badge.new(content, options, html_options, &block).render
  end

  # ProgressBar Component
  #
  # +options+ (Hash)
  # +html_options+ (Hash)
  def ui_progress_bar percentage = nil, options = nil, html_options = nil, &block
    if is_tap(percentage, options)
      UiBibz::Ui::Core::Notifications::ProgressBar.new(percentage, options, html_options).tap(&block).render
    else
      UiBibz::Ui::Core::Notifications::ProgressBar.new(percentage, options, html_options, &block).render
    end
  end

  private

  def is_tap content, options
    (content[:tap] if content.kind_of?(Hash)) || (options[:tap] unless options.nil?)
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ui_bibz-2.0.0.beta2.6 lib/ui_bibz/helpers/ui/core/notifications_helper.rb