Class: SolidusFeeds::Feed

Inherits:
Object
  • Object
show all
Defined in:
lib/solidus_feeds/feed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Feed

Returns a new instance of Feed.

Yields:

  • (_self)

Yield Parameters:



7
8
9
# File 'lib/solidus_feeds/feed.rb', line 7

def initialize
  yield(self) if block_given?
end

Instance Attribute Details

#generatorObject

Returns the value of attribute generator.



5
6
7
# File 'lib/solidus_feeds/feed.rb', line 5

def generator
  @generator
end

#publisherObject

Returns the value of attribute publisher.



5
6
7
# File 'lib/solidus_feeds/feed.rb', line 5

def publisher
  @publisher
end

Instance Method Details

#generate(output) ⇒ Object



11
12
13
# File 'lib/solidus_feeds/feed.rb', line 11

def generate(output)
  generator.call(output)
end

#publishObject



15
16
17
18
19
# File 'lib/solidus_feeds/feed.rb', line 15

def publish
  publisher.call do |output|
    generate(output)
  end
end