Class: Memo::File

Inherits:
Object
  • Object
show all
Defined in:
lib/memo/value/file.rb

Instance Method Summary collapse

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

#dirObject



14
# File 'lib/memo/value/file.rb', line 14

def dir = "#{@namespace}"

#fileObject



15
# File 'lib/memo/value/file.rb', line 15

def file = "#{@file}.#{@config.ext}"

#fullpathObject



16
# File 'lib/memo/value/file.rb', line 16

def fullpath = "#{dir}/#{file}"