Class: Configural::App
- Inherits:
-
Object
- Object
- Configural::App
- Defined in:
- lib/configural/app.rb
Instance Attribute Summary collapse
- #cache_path ⇒ Object
- #config_path ⇒ Object
- #data_path ⇒ Object
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #cache ⇒ Object
- #config ⇒ Object
- #data ⇒ Object
-
#initialize(name) ⇒ App
constructor
A new instance of App.
- #save_all ⇒ Object
Constructor Details
#initialize(name) ⇒ App
Returns a new instance of App.
38 39 40 41 |
# File 'lib/configural/app.rb', line 38 def initialize( name ) @name = name @user = Configural::User.new(self) end |
Instance Attribute Details
#cache_path ⇒ Object
54 55 56 |
# File 'lib/configural/app.rb', line 54 def cache_path @cache_path || (@path and File.join(@path, 'cache')) end |
#config_path ⇒ Object
69 70 71 |
# File 'lib/configural/app.rb', line 69 def config_path @config_path || (@path and File.join(@path, 'config')) end |
#data_path ⇒ Object
84 85 86 |
# File 'lib/configural/app.rb', line 84 def data_path @data_path || (@path and File.join(@path, 'data')) end |
#name ⇒ Object
Returns the value of attribute name.
34 35 36 |
# File 'lib/configural/app.rb', line 34 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
34 35 36 |
# File 'lib/configural/app.rb', line 34 def path @path end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
36 37 38 |
# File 'lib/configural/app.rb', line 36 def user @user end |
Instance Method Details
#cache ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/configural/app.rb', line 44 def cache @cache ||= begin unless @cache_path raise 'you must set cache_path or path first' end Configural::Cache.new(self) end end |
#config ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/configural/app.rb', line 59 def config @config ||= begin unless @config_path raise 'you must set config_path or path first' end Configural::Config.new(self) end end |
#data ⇒ Object
74 75 76 77 78 79 80 81 82 |
# File 'lib/configural/app.rb', line 74 def data @data ||= begin unless @data_path raise 'you must set data_path or path first' end Configural::Data.new(self) end end |
#save_all ⇒ Object
89 90 91 92 93 |
# File 'lib/configural/app.rb', line 89 def save_all @config.save_all if @config @user.save_all if @user self end |