Module: HighVoltage::Configuration

Included in:
HighVoltage
Defined in:
lib/high_voltage/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#content_pathObject

Returns the value of attribute content_path.



3
4
5
# File 'lib/high_voltage/configuration.rb', line 3

def content_path
  @content_path
end

#home_pageObject

Returns the value of attribute home_page.



3
4
5
# File 'lib/high_voltage/configuration.rb', line 3

def home_page
  @home_page
end

#layoutObject

Returns the value of attribute layout.



3
4
5
# File 'lib/high_voltage/configuration.rb', line 3

def layout
  @layout
end

#parent_engineObject

Returns the value of attribute parent_engine.



3
4
5
# File 'lib/high_voltage/configuration.rb', line 3

def parent_engine
  @parent_engine
end

#route_drawerObject

Returns the value of attribute route_drawer.



3
4
5
# File 'lib/high_voltage/configuration.rb', line 3

def route_drawer
  @route_drawer
end

Class Method Details

.extended(base) ⇒ Object



16
17
18
# File 'lib/high_voltage/configuration.rb', line 16

def self.extended(base)
  base.set_default_configuration
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



12
13
14
# File 'lib/high_voltage/configuration.rb', line 12

def configure
  yield self
end

#full_pathObject



24
25
26
# File 'lib/high_voltage/configuration.rb', line 24

def full_path
  Rails.root.join("app", "views", HighVoltage.content_path)
end

#page_idsObject



20
21
22
# File 'lib/high_voltage/configuration.rb', line 20

def page_ids
  HighVoltage::PageCollector.new(HighVoltage.full_path).page_ids
end

#set_default_configurationObject



28
29
30
31
32
33
34
# File 'lib/high_voltage/configuration.rb', line 28

def set_default_configuration
  self.content_path = 'pages/'
  self.home_page = nil
  self.layout = 'application'
  self.route_drawer = HighVoltage::RouteDrawers::Default
  self.routes = true
end