Class: Digup::Setting
Constant Summary collapse
- RESPONSE_TYPE =
[:js, :json, :html]
- LOG_TO =
[:console, :html_body, :db, :file]
- BOOLEAN_SETTINGS =
[:cursor_info]
- DEFAULT_SETTINGS =
{ :response_type => [:js, :json, :html], :log_to => [:console, :html_body], :cursor_info => true }
Class Attribute Summary collapse
-
.options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Class Attribute Details
.options ⇒ Object
Returns the value of attribute options.
15 16 17 |
# File 'lib/digup/setting.rb', line 15 def end |
Class Method Details
.content_type_to_handle ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/digup/setting.rb', line 52 def content_type_to_handle content_type = [] content_type << 'text/html' if handle_html? content_type << 'text/javascript' if handle_js? content_type << 'application/json' if handle_json? content_type end |
.enabled? ⇒ Boolean
29 30 31 |
# File 'lib/digup/setting.rb', line 29 def enabled? .present? end |
.option_to_array(options, key) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/digup/setting.rb', line 44 def option_to_array(, key) if [key].is_a? Array [key] else [[key]] end & DEFAULT_SETTINGS[key] end |