Class: TTK::Fetchers::Client

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#fetcherObject (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

#uriObject



24
25
26
# File 'lib/ttk/fetchers/Client.rb', line 24

def uri
  @service.uri
end