Class: PathGenerator
- Inherits:
-
Object
- Object
- PathGenerator
- Defined in:
- lib/path_generator.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#results_path ⇒ Object
readonly
Returns the value of attribute results_path.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(filepath, results_path, ymd) ⇒ PathGenerator
constructor
A new instance of PathGenerator.
Constructor Details
#initialize(filepath, results_path, ymd) ⇒ PathGenerator
Returns a new instance of PathGenerator.
8 9 10 11 12 13 14 15 |
# File 'lib/path_generator.rb', line 8 def initialize(filepath, results_path, ymd) @filepath = filepath @results_path = results_path @year = ymd & 0b100 != 0 @month = ymd & 0b010 != 0 @day = ymd & 0b001 != 0 @timestamp = Time.now end |
Instance Attribute Details
#day ⇒ Object (readonly)
Returns the value of attribute day.
2 3 4 |
# File 'lib/path_generator.rb', line 2 def day @day end |
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
2 3 4 |
# File 'lib/path_generator.rb', line 2 def filepath @filepath end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
2 3 4 |
# File 'lib/path_generator.rb', line 2 def month @month end |
#results_path ⇒ Object (readonly)
Returns the value of attribute results_path.
2 3 4 |
# File 'lib/path_generator.rb', line 2 def results_path @results_path end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
2 3 4 |
# File 'lib/path_generator.rb', line 2 def @timestamp end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
2 3 4 |
# File 'lib/path_generator.rb', line 2 def year @year end |
Class Method Details
.call(filepath, results_path, ymd) ⇒ Object
4 5 6 |
# File 'lib/path_generator.rb', line 4 def self.call(filepath, results_path, ymd) new(filepath, results_path, ymd).call end |
Instance Method Details
#call ⇒ Object
17 18 19 |
# File 'lib/path_generator.rb', line 17 def call File.join(produce_path, produce_dirname) end |