Sha256: 76924fa92eabfe957e1a8a0f6482c34cfde44bfaae9d1164a47a0cb5addc7927

Contents?: true

Size: 824 Bytes

Versions: 11

Compression:

Stored size: 824 Bytes

Contents

module LucidLocalOperation
  module Mixin
    def self.included(base)
      if RUBY_ENGINE != 'opal'
        Isomorfeus.add_valid_operation_class(base) unless base == LucidLocalOperation::Base

        def pub_sub_client
          Isomorfeus.pub_sub_client
        end
      end

      base.extend(LucidPropDeclaration::Mixin)
      base.extend(LucidOperation::Steps)
      base.include(LucidOperation::PromiseRun)

      base.instance_exec do
        def promise_run(**props_hash)
          self.new(**props_hash).promise_run
        end
      end
    end

    attr_reader :props
    attr_accessor :step_result

    def initialize(**props_hash)
      props_hash = self.class.validated_props(props_hash)
      @props = LucidProps.new(props_hash)
    end

    def current_user
      Isomorfeus.current_user
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
isomorfeus-operation-1.0.0.zeta25 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta24 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta23 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta22 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta21 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta20 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta19 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta18 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta17 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta16 lib/isomorfeus_operation/lucid_local_operation/mixin.rb
isomorfeus-operation-1.0.0.zeta15 lib/isomorfeus_operation/lucid_local_operation/mixin.rb