Class: Eco::API::Organization::Preferences

Inherits:
Object
  • Object
show all
Defined in:
lib/eco/api/organization/preferences.rb

Constant Summary collapse

PREFERENCES_MODEL =
{
  show_sidebar: true,
  show_shortcuts: true,
  show_coming_soon: true,
  show_recently_visited_forms: true,
  show_tasks: true
}.to_json
PREFERENCES_REFERENCE =
File.join(__dir__, 'preferences_reference.json')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(init = {}) ⇒ Preferences

Returns a new instance of Preferences.



19
20
21
22
23
# File 'lib/eco/api/organization/preferences.rb', line 19

def initialize(init = {})
  @preferences_model = JSON.parse(PREFERENCES_MODEL)
  @preferences_reference = JSON.load(File.open(PREFERENCES_REFERENCE))
  @featured_preferences = @preferences_reference.keys
end

Instance Attribute Details

Returns the value of attribute featured_preferences.



17
18
19
# File 'lib/eco/api/organization/preferences.rb', line 17

def featured_preferences
  @featured_preferences
end

#preferences_modelObject (readonly)

Returns the value of attribute preferences_model.



16
17
18
# File 'lib/eco/api/organization/preferences.rb', line 16

def preferences_model
  @preferences_model
end

#preferences_referenceObject (readonly)

Returns the value of attribute preferences_reference.



16
17
18
# File 'lib/eco/api/organization/preferences.rb', line 16

def preferences_reference
  @preferences_reference
end