Class: Jsb3::File
- Inherits:
-
Object
- Object
- Jsb3::File
- Defined in:
- lib/jsb3/file.rb
Instance Method Summary collapse
- #absolute_path ⇒ Object
- #basename ⇒ Object (also: #name)
- #dirname ⇒ Object (also: #path)
- #exists? ⇒ Boolean
-
#initialize(raw_file_hash, resources) ⇒ File
constructor
A new instance of File.
- #to_s ⇒ Object
Constructor Details
#initialize(raw_file_hash, resources) ⇒ File
Returns a new instance of File.
3 4 5 6 7 8 |
# File 'lib/jsb3/file.rb', line 3 def initialize(raw_file_hash, resources) path = raw_file_hash['path'] path = resources.apply(path) @path = path @name = raw_file_hash['name'] end |
Instance Method Details
#absolute_path ⇒ Object
30 31 32 |
# File 'lib/jsb3/file.rb', line 30 def absolute_path ::File.absolute_path(to_s) end |
#basename ⇒ Object Also known as: name
16 17 18 |
# File 'lib/jsb3/file.rb', line 16 def basename ::File.basename(to_path) end |
#dirname ⇒ Object Also known as: path
10 11 12 |
# File 'lib/jsb3/file.rb', line 10 def dirname ::File.dirname(to_path) end |
#exists? ⇒ Boolean
26 27 28 |
# File 'lib/jsb3/file.rb', line 26 def exists? ::File.exists?(to_s) end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/jsb3/file.rb', line 22 def to_s "#{dirname}/#{basename}" end |