Class: Troo::Retrieval::Remote

Inherits:
Object
  • Object
show all
Defined in:
lib/troo/retrieval/remote.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, external_id, options = {}) ⇒ Object

Returns [].

Parameters:

  • []
  • []
  • (Hash)


20
21
22
23
24
# File 'lib/troo/retrieval/remote.rb', line 20

def initialize(klass, external_id, options = {})
  @klass       = klass
  @external_id = external_id
  @options     = options
end

Instance Attribute Details

#external_idObject (readonly)

Returns the value of attribute external_id.



4
5
6
# File 'lib/troo/retrieval/remote.rb', line 4

def external_id
  @external_id
end

Class Method Details

.fetch(klass, external_id, options = {}) ⇒ Object

Returns [].

Parameters:

  • []
  • []
  • (Hash)

Returns:



11
12
13
# File 'lib/troo/retrieval/remote.rb', line 11

def fetch(klass, external_id, options = {})
  new(klass, external_id, options).fetch
end

Instance Method Details

#fetchObject

Returns [].

Returns:



27
28
29
30
31
# File 'lib/troo/retrieval/remote.rb', line 27

def fetch
  return []        if none?
  return persist   if persist?
  resources
end