Class: Trifle::Docs::Harvester::Conveyor

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

Direct Known Subclasses

File::Conveyor, Markdown::Conveyor

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file:, url:, namespace:, cache:) ⇒ Conveyor

Returns a new instance of Conveyor.



87
88
89
90
91
92
# File 'lib/trifle/docs/harvester.rb', line 87

def initialize(file:, url:, namespace:, cache:)
  @file = file
  @url = url
  @namespace = namespace
  @cache = cache
end

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



85
86
87
# File 'lib/trifle/docs/harvester.rb', line 85

def cache
  @cache
end

#fileObject (readonly)

Returns the value of attribute file.



85
86
87
# File 'lib/trifle/docs/harvester.rb', line 85

def file
  @file
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



85
86
87
# File 'lib/trifle/docs/harvester.rb', line 85

def namespace
  @namespace
end

#urlObject (readonly)

Returns the value of attribute url.



85
86
87
# File 'lib/trifle/docs/harvester.rb', line 85

def url
  @url
end

Instance Method Details

#dataObject



94
95
96
97
98
# File 'lib/trifle/docs/harvester.rb', line 94

def data
  @data = nil unless cache

  @data ||= ::File.read(file)
end