Sha256: ba241338f83e380f69154ba5f34e03aa2fe08d93673aecee381ff737b8ed193c

Contents?: true

Size: 563 Bytes

Versions: 23

Compression:

Stored size: 563 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
        ].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

23 entries across 23 versions & 1 rubygems

Version Path
ecoportal-api-0.5.1 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.5.0 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.4.3 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.4.2 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.4.1 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.3.8 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.3.6 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.3.5 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.3.4 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.3.3 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.3.1 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.3.0 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.3.0.pre1 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.2.2 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.2.1 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.2.0 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.1.12 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.1.11 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.1.10 lib/ecoportal/api/internal/preferences.rb
ecoportal-api-0.1.9 lib/ecoportal/api/internal/preferences.rb