Class: AdSpace::Configuration
- Inherits:
-
Object
- Object
- AdSpace::Configuration
- Defined in:
- lib/ad_space/configuration.rb
Constant Summary collapse
- DEFAULT_DASHBOARD_DEFAULT_LOCALE =
"zh-CN"
Instance Attribute Summary collapse
-
#app_name ⇒ Object
writeonly
Sets the attribute app_name.
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#dashboard_default_locale ⇒ Object
Returns the value of attribute dashboard_default_locale.
-
#root_path ⇒ Object
writeonly
Sets the attribute root_path.
Instance Method Summary collapse
- #current_user_method(&block) ⇒ Object
- #current_user_method=(method) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 |
# File 'lib/ad_space/configuration.rb', line 11 def initialize @root_path = "/ad_space" @app_name = ::Rails.application.class.to_s.split("::").first.underscore.humanize(keep_id_suffix: true) @dashboard_default_locale = DEFAULT_DASHBOARD_DEFAULT_LOCALE end |
Instance Attribute Details
#app_name=(value) ⇒ Object (writeonly)
Sets the attribute app_name
5 6 7 |
# File 'lib/ad_space/configuration.rb', line 5 def app_name=(value) @app_name = value end |
#current_user ⇒ Object
Returns the value of attribute current_user.
7 8 9 |
# File 'lib/ad_space/configuration.rb', line 7 def current_user @current_user end |
#dashboard_default_locale ⇒ Object
Returns the value of attribute dashboard_default_locale.
8 9 10 |
# File 'lib/ad_space/configuration.rb', line 8 def dashboard_default_locale @dashboard_default_locale end |
#root_path=(value) ⇒ Object (writeonly)
Sets the attribute root_path
6 7 8 |
# File 'lib/ad_space/configuration.rb', line 6 def root_path=(value) @root_path = value end |
Instance Method Details
#current_user_method(&block) ⇒ Object
17 18 19 |
# File 'lib/ad_space/configuration.rb', line 17 def current_user_method(&block) @current_user = block if block.present? end |
#current_user_method=(method) ⇒ Object
21 22 23 |
# File 'lib/ad_space/configuration.rb', line 21 def current_user_method=(method) @current_user = method if method.present? end |