Class: Skyscraper::Path::Local

Inherits:
Base
  • Object
show all
Defined in:
lib/skyscraper/path/local.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#local?, #path_for, #remote?

Constructor Details

#initialize(path) ⇒ Local

Returns a new instance of Local.



6
7
8
9
10
11
# File 'lib/skyscraper/path/local.rb', line 6

def initialize path
  @folder    = get_folder(path)
  @full_path = path
  @file_name = get_file_name(path)
  @base      = @folder
end

Instance Attribute Details

#baseObject

Returns the value of attribute base.



4
5
6
# File 'lib/skyscraper/path/local.rb', line 4

def base
  @base
end

#file_nameObject

Returns the value of attribute file_name.



4
5
6
# File 'lib/skyscraper/path/local.rb', line 4

def file_name
  @file_name
end

#folderObject

Returns the value of attribute folder.



4
5
6
# File 'lib/skyscraper/path/local.rb', line 4

def folder
  @folder
end

#full_pathObject

Returns the value of attribute full_path.



4
5
6
# File 'lib/skyscraper/path/local.rb', line 4

def full_path
  @full_path
end

Instance Method Details

#full_path_for(href) ⇒ Object



13
14
15
# File 'lib/skyscraper/path/local.rb', line 13

def full_path_for href
  Path.absolute?(href) ? href : "#{@folder}#{href}"
end

#to_sObject



17
18
19
# File 'lib/skyscraper/path/local.rb', line 17

def to_s
  self.full_path
end