Sha256: 86f3b7c8b6e3afcda9ab87d3a4821ce1567aa39b0156ae09bcfbbdec5ee0bbfb

Contents?: true

Size: 628 Bytes

Versions: 1

Compression:

Stored size: 628 Bytes

Contents

module Jot
  module Ruby
    class Operation < SimpleDelegator
      RAW_RESULT_METHODS = %i[isNoOp toJSON apply serialize inspect].freeze
      OPERATION_RESULT_METHODS = %i[simplify drilldown compose rebase].freeze
      DEFAULT_METHODS = RAW_RESULT_METHODS + OPERATION_RESULT_METHODS

      extend Utils::Snippets
      not_implemented *DEFAULT_METHODS

      module OriginalOperationMethods
        OPERATION_RESULT_METHODS.each do |method_name|
          class_eval <<-EOS
            def #{method_name} *args
              self.class.new(super(*args))
            end
          EOS
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jot-ruby-0.1.4 lib/jot/ruby/operation.rb