Sha256: 2298935058c846fe93a50bc49304e83c770fe51b5421a9ae473d5743676d1106

Contents?: true

Size: 989 Bytes

Versions: 5

Compression:

Stored size: 989 Bytes

Contents

module RubyApp

  module Elements

    module Mobile

      module Dialogs
        require 'ruby_app/elements/mobile/dialogs/response_dialog'

        class ExceptionDialog < RubyApp::Elements::Mobile::Dialogs::ResponseDialog

          template_path(:all, File.dirname(__FILE__))

          def initialize(exception)
            super()

            @exception = exception

            @close_link = RubyApp::Elements::Mobile::Dialogs::ResponseDialog::CloseLink.new
            @close_link.clicked do |element, event|
              self.hide(event, element.options)
            end

          end

          def self.show_on_exception(event, options = {})
            begin
              yield
            rescue Exception => exception
              RubyApp::Log.exception(RubyApp::Log::ERROR, exception)
              self.show(event, RubyApp::Elements::Mobile::Dialogs::ExceptionDialog.new(exception), options)
            end
          end

        end

      end

    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
RubyApp-0.5.11 lib/ruby_app/elements/mobile/dialogs/exception_dialog.rb
RubyApp-0.5.10 lib/ruby_app/elements/mobile/dialogs/exception_dialog.rb
RubyApp-0.5.9 lib/ruby_app/elements/mobile/dialogs/exception_dialog.rb
RubyApp-0.5.0 lib/ruby_app/elements/mobile/dialogs/exception_dialog.rb
RubyApp-0.2.8 lib/ruby_app/elements/mobile/dialogs/exception_dialog.rb