Class: AdSpace::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/ad_space/configuration.rb

Constant Summary collapse

DEFAULT_DASHBOARD_DEFAULT_LOCALE =
"zh-CN"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

Parameters:

  • value

    the value to set the attribute app_name to.



5
6
7
# File 'lib/ad_space/configuration.rb', line 5

def app_name=(value)
  @app_name = value
end

#current_userObject

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_localeObject

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

Parameters:

  • value

    the value to set the attribute root_path to.



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