Sha256: d3ad694ab8f52b1d4fd066f225c9f1957ab8c89c169db65c3d1c6374a52189f5

Contents?: true

Size: 680 Bytes

Versions: 3

Compression:

Stored size: 680 Bytes

Contents

module InternalAffairs
  class NoopOperation
    attr_reader :attributes

    def self.load_from_operation_serialized_attributes(_attributes)
      new(_attributes)
    end

    def attributes_for_operation_serialization
      attributes
    end

    def initialize(_attributes)
      @attributes = _attributes
    end

    def approvable_user
      @attributes[:user]
    end

    def approvable_operation
      @attributes[:operation]
    end

    def approvable_resources
      @attributes[:resources] || []
    end

    def approvable_amount
      @attributes[:amount]
    end

    def approve!
      # do nothing
    end

    def reject!
      # do nothing
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
internal-affairs-1.1.0 lib/internal_affairs/noop_operation.rb
internal-affairs-1.0.1 lib/internal_affairs/noop_operation.rb
internal-affairs-1.0.0 lib/internal_affairs/noop_operation.rb