module Milestoner::Builders::Syndication::Shared
Provides shared functionality for refinements.
Public Instance Methods
Source
# File lib/milestoner/builders/syndication/shared.rb, line 14 def build(**attributes) node = public_send :"new_#{kind}" attributes.each { |key, value| node.public_send :"#{key}=", value } end
Source
# File lib/milestoner/builders/syndication/shared.rb, line 10 def build_for(collection, **) collection.each { |attributes| build(**attributes.transform_keys(**)) } end
Source
# File lib/milestoner/builders/syndication/shared.rb, line 21 def kind self.class.name.downcase.split("::").last.sub("categories", "category").delete_suffix("s") end
Source
# File lib/milestoner/builders/syndication/shared.rb, line 8 def merge(**attributes) = attributes.each { |key, value| public_send :"#{key}=", value } def build_for(collection, **) collection.each { |attributes| build(**attributes.transform_keys(**)) } end def build(**attributes) node = public_send :"new_#{kind}" attributes.each { |key, value| node.public_send :"#{key}=", value } end private def kind self.class.name.downcase.split("::").last.sub("categories", "category").delete_suffix("s") end end