Class: Dutiful::File
- Inherits:
-
Object
- Object
- Dutiful::File
- Defined in:
- lib/dutiful/file.rb
Instance Attribute Summary collapse
-
#full_path ⇒ Object
readonly
Returns the value of attribute full_path.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(path) ⇒ File
constructor
A new instance of File.
- #synced? ⇒ Boolean
Constructor Details
#initialize(path) ⇒ File
Returns a new instance of File.
5 6 7 8 |
# File 'lib/dutiful/file.rb', line 5 def initialize(path) @path = path @full_path = ::File. "~/#{path}" end |
Instance Attribute Details
#full_path ⇒ Object (readonly)
Returns the value of attribute full_path.
3 4 5 |
# File 'lib/dutiful/file.rb', line 3 def full_path @full_path end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/dutiful/file.rb', line 3 def path @path end |
Instance Method Details
#exist? ⇒ Boolean
10 11 12 |
# File 'lib/dutiful/file.rb', line 10 def exist? ::File.exist? @full_path end |
#synced? ⇒ Boolean
14 15 16 |
# File 'lib/dutiful/file.rb', line 14 def synced? Dutiful::Config.storage.exist?(self) && Dutiful::Config.storage.synced?(self) end |