Sha256: 17a16023af57ad714bfe7cd03bb617fc3504c702a87c665bd7ccf7b3de84c484

Contents?: true

Size: 1.2 KB

Versions: 32

Compression:

Stored size: 1.2 KB

Contents

module Ecoportal
  module API
    class Internal
      class Preferences
        [
          :show_sidebar,
          :show_shortcuts,
          :show_coming_soon,
          :show_recently_visited_forms,
          :show_tasks,
        ].each do |field|
          key = field.to_s
          define_method(field) do
            if doc.key?(key)
              doc[key]
            else
              true
            end
          end
          define_method("#{field}=") do |value|
            doc[key] = !!value
          end
        end

        [
          :kiosk_enabled,
          :kiosk_workflow_message,
          :kiosk_create_button_label,
          :kiosk_create_button_help,
          :kiosk_return_button_label,
          :kiosk_return_button_help,
          :kiosk_dashboard_button_label,
          :kiosk_dashboard_button_help
        ].each do |field|
          key = field.to_s
          define_method(field) do
            if doc.key?(key)
              doc[key]
            else
              nil
            end
          end
          define_method("#{field}=") do |value|
            doc[key] = !!value
          end
        end

      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
eco-helpers-1.3.15 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.14 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.13 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.12 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.11 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.10 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.9 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.8 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.7 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.6 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.5 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.4 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.3 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.2 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.3.1 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.2.2 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.2.1 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.1.8 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.1.7 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
eco-helpers-1.1.6 lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb