Class: Bridgetown::Current

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCurrent

Returns a new instance of Current.



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

def initialize
  super
  @attributes[:sites] = {}
end

Class Method Details

.preloaded_configurationBridgetown::Configuration



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

attribute :preloaded_configuration

.siteBridgetown::Site?

Returns:



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

def self.site
  sites[:main]
end

.site=(new_site) ⇒ Object



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

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

.sitesHash<Symbol, Bridgetown::Site>

Returns:



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

attribute :sites