Class: KStarter::Database::BaseModel
- Inherits:
-
Object
- Object
- KStarter::Database::BaseModel
- Defined in:
- lib/k_starter/database/base_model.rb
Overview
Handle access to project data and configuration JSON files
Direct Known Subclasses
Instance Attribute Summary collapse
-
#backup_folder ⇒ Object
readonly
Returns the value of attribute backup_folder.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#folder ⇒ Object
readonly
Returns the value of attribute folder.
Instance Method Summary collapse
-
#initialize(**args) ⇒ BaseModel
constructor
Split Config and Data into two classes.
Constructor Details
#initialize(**args) ⇒ BaseModel
Split Config and Data into two classes
13 14 15 16 17 18 |
# File 'lib/k_starter/database/base_model.rb', line 13 def initialize(**args) @folder = args[:folder] || '~/.config' @folder = File.(folder) @backup_folder = File.join(folder, 'klue_backup') @filename = File.join(@folder, args[:file]) end |
Instance Attribute Details
#backup_folder ⇒ Object (readonly)
Returns the value of attribute backup_folder.
8 9 10 |
# File 'lib/k_starter/database/base_model.rb', line 8 def backup_folder @backup_folder end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/k_starter/database/base_model.rb', line 10 def data @data end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
9 10 11 |
# File 'lib/k_starter/database/base_model.rb', line 9 def filename @filename end |
#folder ⇒ Object (readonly)
Returns the value of attribute folder.
7 8 9 |
# File 'lib/k_starter/database/base_model.rb', line 7 def folder @folder end |