Module: Mumuki::Domain::Syncable::WithResourceFields

Extended by:
ActiveSupport::Concern
Defined in:
lib/mumuki/domain/syncable/with_resource_fields.rb

Overview

Syncable objects that also declare a ‘resource_fields` method can define `resource_h` and `self.slice_resource_h` based on it.

Instance Method Summary collapse

Instance Method Details

#to_resource_hObject



8
9
10
# File 'lib/mumuki/domain/syncable/with_resource_fields.rb', line 8

def to_resource_h
  self.class.resource_fields.map { |it| [it, send(it)] }.to_h.compact
end