Class: Qcourses::Configuration::Instance
- Inherits:
-
Object
- Object
- Qcourses::Configuration::Instance
- Defined in:
- lib/qcourses/configuration.rb
Instance Attribute Summary collapse
-
#local_root ⇒ Object
Returns the value of attribute local_root.
- #root ⇒ Object
-
#views ⇒ Object
Returns the value of attribute views.
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #file(path) ⇒ Object
-
#initialize ⇒ Instance
constructor
A new instance of Instance.
Constructor Details
#initialize ⇒ Instance
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_root ⇒ Object
Returns the value of attribute local_root.
5 6 7 |
# File 'lib/qcourses/configuration.rb', line 5 def local_root @local_root end |
#root ⇒ Object
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 |
#views ⇒ Object
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
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.(path, root) end |