Module: Milestoner::Syndication::Shared

Defined in:
lib/milestoner/syndication/shared.rb

Overview

Provides shared functionality for refinements.

Instance Method Summary collapse

Instance Method Details

#build(**attributes) ⇒ Object



13
14
15
16
# File 'lib/milestoner/syndication/shared.rb', line 13

def build(**attributes)
  node = public_send :"new_#{kind}"
  attributes.each { |key, value| node.public_send :"#{key}=", value }
end

#build_for(collection) ⇒ Object



9
10
11
# File 'lib/milestoner/syndication/shared.rb', line 9

def build_for(collection, **)
  collection.each { |attributes| build(**attributes.transform_keys(**)) }
end

#merge(**attributes) ⇒ Object



7
# File 'lib/milestoner/syndication/shared.rb', line 7

def merge(**attributes) = attributes.each { |key, value| public_send :"#{key}=", value }