Sha256: 2c6655dcbc2e44009ef4a0df1e2f67db2dae4be05715c12a271b63b7d61c4c64
Contents?: true
Size: 1.18 KB
Versions: 17
Compression:
Stored size: 1.18 KB
Contents
class Eco::API::UseCases::GraphQL::Helpers::Location::Command::Diffs module Stages module Commandable class << self def included(base) super base.extend(ClassMethods) base.send(:include, DiffSortable) end end module ClassMethods def stage_command(stage) return :update if stage == :id_name stage end end # builds up the particular graphql location commands def stage_commands(stage) stage_command = self.class.stage_command(stage) stage_updates(stage).map do |update| {}.tap do |comm| comm[stage_command] = symbolize_keys(update) end end end private def stage_updates(stage) aiu = self.class.after_id_update?(stage) stage_diffs(stage).map do |dfs| dfs.as_update(stage, after_id_update: aiu) end end def stage_diffs(stage) raise "There is NO support for stage '#{stage}'. Please review" unless respond_to?(stage) sort_diffs(stage) do send(stage) end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems