Class: Phill::File
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #compressed_file ⇒ Object
- #compressed_name ⇒ Object
-
#initialize(path) ⇒ File
constructor
A new instance of File.
- #process ⇒ Object
Constructor Details
#initialize(path) ⇒ File
Returns a new instance of File.
10 11 12 |
# File 'lib/phill/file.rb', line 10 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/phill/file.rb', line 8 def path @path end |
Instance Method Details
#compressed_file ⇒ Object
19 20 21 |
# File 'lib/phill/file.rb', line 19 def compressed_file @compressed_file ||= File.open(compressed_path, 'rb') end |
#compressed_name ⇒ Object
23 24 25 |
# File 'lib/phill/file.rb', line 23 def compressed_name @compressed_name ||= compressed_path.gsub(/.*\//, '') end |
#process ⇒ Object
14 15 16 17 |
# File 'lib/phill/file.rb', line 14 def process compress File.open(path, 'w').close end |