Class: Eco::API::Session::Config::Files
Instance Attribute Summary
Attributes inherited from BaseConfig
#config
Instance Method Summary
collapse
Methods inherited from BaseConfig
#clone
Methods inherited from Hash
#deep_merge, #deep_merge!
Constructor Details
#initialize(config:) ⇒ Files
Returns a new instance of Files.
7
8
9
10
|
# File 'lib/eco/api/session/config/files.rb', line 7
def initialize(config:)
super(config: config)
@validations = {}
end
|
Instance Method Details
#add_validation(format) ⇒ Object
28
29
30
31
|
# File 'lib/eco/api/session/config/files.rb', line 28
def add_validation(format)
raise "Block must be given" unless block_given?
@validations[format] = Proc.new
end
|
#timestamp_pattern ⇒ Object
24
25
26
|
# File 'lib/eco/api/session/config/files.rb', line 24
def timestamp_pattern
self["timestamp_pattern"]
end
|
#timestamp_pattern=(pattern) ⇒ Object
20
21
22
|
# File 'lib/eco/api/session/config/files.rb', line 20
def timestamp_pattern=(pattern)
self["timestamp_pattern"] = pattern
end
|
#validate(format, input) ⇒ Object
33
34
35
|
# File 'lib/eco/api/session/config/files.rb', line 33
def validate(format, input)
@validations[format].call(input) if @validations.key?(format)
end
|
#working_directory ⇒ Object
16
17
18
|
# File 'lib/eco/api/session/config/files.rb', line 16
def working_directory
self["dir"]
end
|
#working_directory=(path) ⇒ Object
12
13
14
|
# File 'lib/eco/api/session/config/files.rb', line 12
def working_directory=(path)
self["dir"] = path
end
|