Sha256: 77ff15351e96523d41902804970f13f40fc39c223d181e8a4b2641f041e3c42b

Contents?: true

Size: 903 Bytes

Versions: 2

Compression:

Stored size: 903 Bytes

Contents

# frozen_string_literal: true

require 'europeana/feedback_button/engine'

module Europeana
  module FeedbackButton
    PRIVACY_POLICY_URL = 'https://www.europeana.eu/portal/rights/privacy.html'

    class << self
      # @return [String] Email recipient of feedback submissions
      attr_accessor :mail_to

      # @return [String] URL to the privacy policy users must accept
      attr_accessor :privacy_policy_url

      # Is feedback enabled?
      #
      # Feedback will be enabled if +mail_to+ is set.
      #
      # @return [Boolean]
      def enabled?
        mail_to.present?
      end
    end

    self.privacy_policy_url = PRIVACY_POLICY_URL

    class ApplicationError < StandardError
      attr_reader :errors

      def initialize(message, **options)
        super(message)
        @errors = options[:errors]
      end
    end

    class NoRecipientError < StandardError; end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
europeana-feedback-button-0.0.7 lib/europeana/feedback_button.rb
europeana-feedback-button-0.0.6 lib/europeana/feedback_button.rb