Class: Memo::File
- Inherits:
-
Object
- Object
- Memo::File
- Defined in:
- lib/memo/value/file.rb
Instance Method Summary collapse
- #dir ⇒ Object
- #file ⇒ Object
- #fullpath ⇒ Object
-
#initialize(file = nil, namespace = nil, config: Memo::Config.new) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(file = nil, namespace = nil, config: Memo::Config.new) ⇒ File
Returns a new instance of File.
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/memo/value/file.rb', line 3 def initialize( file = nil, namespace = nil, config: Memo::Config.new ) @config = config @file = file || @config.default_filename @namespace = Alias::Namespace.new(namespace).call || @config.default_namespace end |
Instance Method Details
#dir ⇒ Object
14 |
# File 'lib/memo/value/file.rb', line 14 def dir = "#{@namespace}" |
#file ⇒ Object
15 |
# File 'lib/memo/value/file.rb', line 15 def file = "#{@file}.#{@config.ext}" |
#fullpath ⇒ Object
16 |
# File 'lib/memo/value/file.rb', line 16 def fullpath = "#{dir}/#{file}" |