Class: Hadupils::Assets::File
- Inherits:
-
Object
- Object
- Hadupils::Assets::File
- Defined in:
- lib/hadupils/assets.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #hidden? ⇒ Boolean
- #hiverc_command ⇒ Object
-
#initialize(path) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(path) ⇒ File
Returns a new instance of File.
13 14 15 16 |
# File 'lib/hadupils/assets.rb', line 13 def initialize(path) @path = path @name = self.class.determine_name(path) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/hadupils/assets.rb', line 3 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/hadupils/assets.rb', line 3 def path @path end |
Class Method Details
.determine_name(path) ⇒ Object
5 6 7 |
# File 'lib/hadupils/assets.rb', line 5 def self.determine_name(path) ::File.basename(path) end |
.hiverc_type ⇒ Object
9 10 11 |
# File 'lib/hadupils/assets.rb', line 9 def self.hiverc_type :FILE end |
Instance Method Details
#hidden? ⇒ Boolean
18 19 20 |
# File 'lib/hadupils/assets.rb', line 18 def hidden? name[0] == '.' end |
#hiverc_command ⇒ Object
22 23 24 |
# File 'lib/hadupils/assets.rb', line 22 def hiverc_command "ADD #{self.class.hiverc_type} #{path};" end |