Class: LoyalAdmin::Config
- Inherits:
-
Object
- Object
- LoyalAdmin::Config
- Defined in:
- lib/loyal_admin/config.rb
Instance Method Summary collapse
- #info_config ⇒ Object
- #info_config=(info = DEFAULT_INFO_CONFIGS) ⇒ Object
- #prepend_view_paths ⇒ Object
-
#request_routes_constraints?(request) ⇒ Boolean
判断请求是否可以路由到passport中来.
- #subdomain ⇒ Object
- #subdomain=(subdomain = DEFAULT_SUBDOMAIN) ⇒ Object
- #white_hosts ⇒ Object
- #white_hosts=(hosts = DEFAULT_WHITE_HOSTS) ⇒ Object
Instance Method Details
#info_config ⇒ Object
22 23 24 |
# File 'lib/loyal_admin/config.rb', line 22 def info_config @info_config ||= DEFAULT_INFO_CONFIGS end |
#info_config=(info = DEFAULT_INFO_CONFIGS) ⇒ Object
26 27 28 29 30 |
# File 'lib/loyal_admin/config.rb', line 26 def info_config= info=DEFAULT_INFO_CONFIGS @info_config ||= ( DEFAULT_INFO_CONFIGS.merge(info) ) end |
#prepend_view_paths ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/loyal_admin/config.rb', line 42 def prepend_view_paths @prepend_view_paths ||= ( self.white_hosts.inject({}) do |result, pair| host, config = pair if config[:view_paths] result[host] = ::LoyalCore::ArrayUtil.init(config[:view_paths]) end result end ) end |
#request_routes_constraints?(request) ⇒ Boolean
判断请求是否可以路由到passport中来
65 66 67 |
# File 'lib/loyal_admin/config.rb', line 65 def request_routes_constraints?(request) request.subdomain == self.subdomain end |
#subdomain ⇒ Object
60 61 62 |
# File 'lib/loyal_admin/config.rb', line 60 def subdomain @subdomain ||= DEFAULT_SUBDOMAIN end |
#subdomain=(subdomain = DEFAULT_SUBDOMAIN) ⇒ Object
56 57 58 |
# File 'lib/loyal_admin/config.rb', line 56 def subdomain= subdomain=DEFAULT_SUBDOMAIN @subdomain ||= subdomain end |
#white_hosts ⇒ Object
38 39 40 |
# File 'lib/loyal_admin/config.rb', line 38 def white_hosts @white_hosts ||= DEFAULT_WHITE_HOSTS end |
#white_hosts=(hosts = DEFAULT_WHITE_HOSTS) ⇒ Object
32 33 34 35 36 |
# File 'lib/loyal_admin/config.rb', line 32 def white_hosts= hosts=DEFAULT_WHITE_HOSTS @white_hosts ||= ( DEFAULT_WHITE_HOSTS.merge(hosts) ) end |