Class: Eco::API::Organization::Preferences
- 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
-
#featured_preferences ⇒ Object
readonly
Returns the value of attribute featured_preferences.
-
#preferences_model ⇒ Object
readonly
Returns the value of attribute preferences_model.
-
#preferences_reference ⇒ Object
readonly
Returns the value of attribute preferences_reference.
Instance Method Summary collapse
-
#initialize(init = {}) ⇒ Preferences
constructor
A new instance of Preferences.
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
#featured_preferences ⇒ Object (readonly)
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_model ⇒ Object (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_reference ⇒ Object (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 |