Class: Deadlink::Path
- Inherits:
-
Object
- Object
- Deadlink::Path
- Defined in:
- lib/deadlink/path.rb
Instance Attribute Summary collapse
-
#anchor ⇒ Object
readonly
Returns the value of attribute anchor.
-
#cur_file_path ⇒ Object
readonly
Returns the value of attribute cur_file_path.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
Instance Method Summary collapse
- #deadlink?(files) ⇒ Boolean
-
#initialize(cur_file_path, link, index, repo_root) ⇒ Path
constructor
A new instance of Path.
Constructor Details
#initialize(cur_file_path, link, index, repo_root) ⇒ Path
Returns a new instance of Path.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/deadlink/path.rb', line 7 def initialize(cur_file_path, link, index, repo_root) @cur_file_path = cur_file_path @link = link @index = index @repo_root = repo_root hash = split_link(link) @anchor = hash[:anchor] @link_file_path = hash[:filepath] @abs_link_file_path = abs_link_file_path end |
Instance Attribute Details
#anchor ⇒ Object (readonly)
Returns the value of attribute anchor.
5 6 7 |
# File 'lib/deadlink/path.rb', line 5 def anchor @anchor end |
#cur_file_path ⇒ Object (readonly)
Returns the value of attribute cur_file_path.
5 6 7 |
# File 'lib/deadlink/path.rb', line 5 def cur_file_path @cur_file_path end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
5 6 7 |
# File 'lib/deadlink/path.rb', line 5 def index @index end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
5 6 7 |
# File 'lib/deadlink/path.rb', line 5 def link @link end |
Instance Method Details
#deadlink?(files) ⇒ Boolean
21 22 23 |
# File 'lib/deadlink/path.rb', line 21 def deadlink?(files) (not_exist? || anchor_invalid?(files)) && not_ignore? end |