Class: ExceptionNotifier::AsanaNotifier
- Inherits:
-
BaseNotifier
- Object
- BaseNotifier
- ExceptionNotifier::AsanaNotifier
- Defined in:
- lib/asana_exception_notifier/classes/asana.rb
Overview
module that is used for formatting numbers using metrics
Instance Attribute Summary collapse
-
#default_options ⇒ Object
readonly
the base url to which the API will connect for fetching information about gems.
-
#initial_options ⇒ Object
readonly
the base url to which the API will connect for fetching information about gems.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #call(exception, options = {}) ⇒ Object
-
#initialize(options) ⇒ AsanaNotifier
constructor
A new instance of AsanaNotifier.
Methods included from AsanaExceptionNotifier::ApplicationHelper
add_files_to_zip, compress_files, create_archive, create_upload_file_part, default_template_path, ensure_eventmachine_running, escape, execute_with_rescue, extract_body, file_upload_request_options, force_utf8_encoding, get_extension_and_name_from_file, get_hash_rows, get_multi_request_values, get_response_from_request, hash_to_html_attributes, link_helper, log_bactrace, log_exception, logger, max_length, mount_table, mount_table_for_hash, multi_request_manager, multipart_file_upload_details, parse_fieldset_value, permitted_options, register_em_error_handler, rescue_interrupt, root, run_em_reactor, set_fieldset_key, setup_em_options, show_hash_content, split_archive, tempfile_details, template_dir, template_path_exist
Constructor Details
#initialize(options) ⇒ AsanaNotifier
Returns a new instance of AsanaNotifier.
15 16 17 18 19 20 21 22 |
# File 'lib/asana_exception_notifier/classes/asana.rb', line 15 def initialize() execute_with_rescue do super @initial_options = .symbolize_keys = @initial_options.reject { |_key, value| value.blank? } () end end |
Instance Attribute Details
#default_options ⇒ Object (readonly)
the base url to which the API will connect for fetching information about gems
13 14 15 |
# File 'lib/asana_exception_notifier/classes/asana.rb', line 13 def @default_options end |
#initial_options ⇒ Object (readonly)
the base url to which the API will connect for fetching information about gems
13 14 15 |
# File 'lib/asana_exception_notifier/classes/asana.rb', line 13 def @initial_options end |
Instance Method Details
#active? ⇒ Boolean
34 35 36 |
# File 'lib/asana_exception_notifier/classes/asana.rb', line 34 def active? @default_options.fetch(:asana_api_key, nil).present? && @default_options.fetch(:workspace, nil).present? end |
#call(exception, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/asana_exception_notifier/classes/asana.rb', line 24 def call(exception, = {}) execute_with_rescue do ensure_eventmachine_running do EM::HttpRequest.use AsanaExceptionNotifier::Request::Middleware if ENV['DEBUG_ASANA_EXCEPTION_NOTIFIER'] error_page = AsanaExceptionNotifier::ErrorPage.new(template_path, exception, ) create_asana_task(error_page) if active? end end end |