Class: Trifle::Docs::Operations::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/trifle/docs/operations/collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**keywords) ⇒ Collection

Returns a new instance of Collection.



9
10
11
12
# File 'lib/trifle/docs/operations/collection.rb', line 9

def initialize(**keywords)
  @url = keywords.fetch(:url)
  @config = keywords[:config]
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/trifle/docs/operations/collection.rb', line 7

def url
  @url
end

Instance Method Details

#configObject



14
15
16
# File 'lib/trifle/docs/operations/collection.rb', line 14

def config
  @config || Trifle::Docs.default
end

#performObject



18
19
20
# File 'lib/trifle/docs/operations/collection.rb', line 18

def perform
  config.harvester.collection_for(url: url)
end