Class: Fairy::PFilePlace
- Inherits:
-
Object
- Object
- Fairy::PFilePlace
- Defined in:
- lib/fairy/share/file-place.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#no ⇒ Object
readonly
Returns the value of attribute no.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, no) ⇒ PFilePlace
constructor
A new instance of PFilePlace.
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
#host ⇒ Object (readonly)
Returns the value of attribute host.
56 57 58 |
# File 'lib/fairy/share/file-place.rb', line 56 def host @host end |
#no ⇒ Object (readonly)
Returns the value of attribute no.
55 56 57 |
# File 'lib/fairy/share/file-place.rb', line 55 def no @no end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
57 58 59 |
# File 'lib/fairy/share/file-place.rb', line 57 def path @path end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
54 55 56 |
# File 'lib/fairy/share/file-place.rb', line 54 def url @url end |