Class: TTK::Fetchers::Client
- Includes:
- DRb::DRbUndumped
- Defined in:
- lib/ttk/fetchers/Client.rb,
lib/ttk/fetchers/client/receiver.rb
Defined Under Namespace
Classes: Receiver
Instance Attribute Summary collapse
-
#fetcher ⇒ Object
readonly
Returns the value of attribute fetcher.
Instance Method Summary collapse
- #fetch(resource, dest) ⇒ Object
-
#initialize(service, fetcher) ⇒ Client
constructor
A new instance of Client.
- #uri ⇒ Object
Constructor Details
#initialize(service, fetcher) ⇒ Client
Returns a new instance of Client.
17 18 19 20 |
# File 'lib/ttk/fetchers/Client.rb', line 17 def initialize(service, fetcher) @service = service @fetcher = fetcher end |
Instance Attribute Details
#fetcher ⇒ Object (readonly)
Returns the value of attribute fetcher.
22 23 24 |
# File 'lib/ttk/fetchers/Client.rb', line 22 def fetcher @fetcher end |
Instance Method Details
#fetch(resource, dest) ⇒ Object
28 29 30 31 32 |
# File 'lib/ttk/fetchers/Client.rb', line 28 def fetch(resource, dest) recv = Receiver.new(dest + resource) # keep this local variable for GC @fetcher.fetch(resource, recv) recv.stat end |
#uri ⇒ Object
24 25 26 |
# File 'lib/ttk/fetchers/Client.rb', line 24 def uri @service.uri end |