Class: Qcourses::Configuration::Instance

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInstance

Returns a new instance of Instance.



7
8
9
# File 'lib/qcourses/configuration.rb', line 7

def initialize
  @views = 'views'
end

Instance Attribute Details

#local_rootObject

Returns the value of attribute local_root.



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

def local_root
  @local_root
end

#rootObject

Raises:



14
15
16
17
# File 'lib/qcourses/configuration.rb', line 14

def root 
  raise Error.new("please configure root first") if @root.nil?
  @root
end

#viewsObject

Returns the value of attribute views.



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

def views
  @views
end

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:



10
11
12
13
# File 'lib/qcourses/configuration.rb', line 10

def configure(&block) 
  self.views= "views/qcourses" 
  yield(self)
end

#file(path) ⇒ Object



18
19
20
# File 'lib/qcourses/configuration.rb', line 18

def file(path)
  File.expand_path(path, root)
end