Class: DatasetSource
- Inherits:
-
Object
- Object
- DatasetSource
- Defined in:
- lib/kaba/dataset_source.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ DatasetSource
constructor
A new instance of DatasetSource.
- #join(name) ⇒ Object
- #read ⇒ Object
- #to_path ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path) ⇒ DatasetSource
Returns a new instance of DatasetSource.
4 5 6 |
# File 'lib/kaba/dataset_source.rb', line 4 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/kaba/dataset_source.rb', line 3 def path @path end |
Class Method Details
.podfile ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/kaba/dataset_source.rb', line 31 def podfile d_podfile_path = File.join(Dir.pwd, 'DPodfile.rb') unless File.exist?(d_podfile_path) FileUtils.cp(File.join(__dir__, '_DPodfile_'), d_podfile_path) end d_podfile_path end |
.testfile ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/kaba/dataset_source.rb', line 39 def testfile d_testfile_path = File.join(Dir.pwd, 'DTestfile.rb') unless File.exist?(d_testfile_path) FileUtils.cp(File.join(__dir__, '_DTestfile_'), d_testfile_path) end d_testfile_path end |
Instance Method Details
#join(name) ⇒ Object
26 27 28 |
# File 'lib/kaba/dataset_source.rb', line 26 def join(name) self.class.new File.join(@path, name) end |
#read ⇒ Object
14 15 16 |
# File 'lib/kaba/dataset_source.rb', line 14 def read File.read @path end |
#to_path ⇒ Object
22 23 24 |
# File 'lib/kaba/dataset_source.rb', line 22 def to_path @path end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/kaba/dataset_source.rb', line 18 def to_s @path end |