Class: Fwd::Backend
- Inherits:
-
Object
- Object
- Fwd::Backend
- Defined in:
- lib/fwd/backend.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(url) ⇒ Backend
constructor
A new instance of Backend.
- #stream(file) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(url) ⇒ Backend
Returns a new instance of Backend.
4 5 6 |
# File 'lib/fwd/backend.rb', line 4 def initialize(url) @url = URI(url) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
2 3 4 |
# File 'lib/fwd/backend.rb', line 2 def url @url end |
Instance Method Details
#close ⇒ Object
12 13 14 15 |
# File 'lib/fwd/backend.rb', line 12 def close @sock.close if @sock @sock = nil end |
#stream(file) ⇒ Object
8 9 10 |
# File 'lib/fwd/backend.rb', line 8 def stream(file) IO.copy_stream file.to_s, sock end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/fwd/backend.rb', line 17 def to_s url.to_s end |