Sha256: 111ef33e64d7e1d51ae9d39a6a8815e5f8565b7668f2c81c390bfec511f6e439
Contents?: true
Size: 1.18 KB
Versions: 23
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
23 entries across 23 versions & 1 rubygems