Class: Bridgetown::Current

Inherits:
Object
  • Object
show all
Defined in:
bridgetown-core/lib/bridgetown-core/current.rb

Class Method Summary collapse

Class Method Details

.preloaded_configurationBridgetown::Configuration



23
# File 'bridgetown-core/lib/bridgetown-core/current.rb', line 23

def preloaded_configuration = thread_state[:preloaded_configuration]

.preloaded_configuration=(value) ⇒ Object



25
26
27
# File 'bridgetown-core/lib/bridgetown-core/current.rb', line 25

def preloaded_configuration=(value)
  thread_state[:preloaded_configuration] = value
end

.siteBridgetown::Site?

Returns:



11
# File 'bridgetown-core/lib/bridgetown-core/current.rb', line 11

def site = sites[:main]

.site=(new_site) ⇒ Object



13
14
15
# File 'bridgetown-core/lib/bridgetown-core/current.rb', line 13

def site=(new_site)
  sites[:main] = new_site
end

.sitesHash<Symbol, Bridgetown::Site>

Returns:



18
19
20
# File 'bridgetown-core/lib/bridgetown-core/current.rb', line 18

def sites
  thread_state[:sites] ||= {}
end

.thread_stateObject



8
# File 'bridgetown-core/lib/bridgetown-core/current.rb', line 8

def thread_state = Thread.current.bridgetown_state ||= {}