Class: Fairy::PFilePlace

Inherits:
Object
  • Object
show all
Defined in:
lib/fairy/share/file-place.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, no) ⇒ PFilePlace

Returns a new instance of PFilePlace.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fairy/share/file-place.rb', line 38

def initialize(url, no)
  @url = url
  @no = no

  @host = "localhost"
  @path = @url
  if URI_REGEXP =~ @url
	uri = URI(@url)
	@host = uri.host
	if /^\[([0-9a-f.:]*)\]$/ =~ @host
	  @host = $1
	end
	@path = uri.path
  end
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



56
57
58
# File 'lib/fairy/share/file-place.rb', line 56

def host
  @host
end

#noObject (readonly)

Returns the value of attribute no.



55
56
57
# File 'lib/fairy/share/file-place.rb', line 55

def no
  @no
end

#pathObject (readonly)

Returns the value of attribute path.



57
58
59
# File 'lib/fairy/share/file-place.rb', line 57

def path
  @path
end

#urlObject (readonly)

Returns the value of attribute url.



54
55
56
# File 'lib/fairy/share/file-place.rb', line 54

def url
  @url
end