Class: Milestoner::Syndication::Builder
- Inherits:
-
Object
- Object
- Milestoner::Syndication::Builder
- Defined in:
- lib/milestoner/syndication/builder.rb
Overview
Builds feed in Atom format. :reek:DataClump
Class Method Summary collapse
Instance Method Summary collapse
- #call(tags) ⇒ Object
-
#initialize(client: RSS::Maker, view: Views::Milestones::Show.new) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(client: RSS::Maker, view: Views::Milestones::Show.new) ⇒ Builder
Returns a new instance of Builder.
23 24 25 26 27 |
# File 'lib/milestoner/syndication/builder.rb', line 23 def initialize(client: RSS::Maker, view: Views::Milestones::Show.new, **) super(**) @client = client @view = view end |
Class Method Details
.authors_for(tags) ⇒ Object
17 18 19 20 21 |
# File 'lib/milestoner/syndication/builder.rb', line 17 def self. .flat_map { |tag| tag.commits.map(&:author) } .then { |users| users.any? ? users : .map(&:author) } .uniq end |
Instance Method Details
#call(tags) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/milestoner/syndication/builder.rb', line 29 def call return Failure "No tags or commits." if .empty? Success build_feed().to_s rescue NoMethodError, RSS::Error => error Failure "#{self.class}: #{error..capitalize}." end |