Sha256: dc2143f51b32d410cf224d0207870537d178792639453de94f3e66f37be7d777

Contents?: true

Size: 897 Bytes

Versions: 2

Compression:

Stored size: 897 Bytes

Contents

module Ecoportal
  module API
    class Internal
      class Preferences < Common::BaseModel
        [
          :show_sidebar,
          :show_shortcuts,
          :show_coming_soon,
          :show_recently_visited_forms,
          :show_tasks,
          :show_task_bubbles,
          :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
        ].map(&:to_s).each do |field|
          define_method(field) do
            if doc.key?(field)
              doc[field]
            else
              true
            end
          end
          define_method("#{field}=") do |value|
            doc[field] = !!value
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ecoportal-api-0.5.8 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.5.7 lib/ecoportal/api/internal/preferences.rb