Sha256: 38310b86d2df33674874197538cc5e4c52653b5a8e7e2a513b241abf89fc4d85

Contents?: true

Size: 746 Bytes

Versions: 15

Compression:

Stored size: 746 Bytes

Contents

# frozen_string_literal: true

class Sinclair
  class MethodBuilder
    # @api private
    # @author darthjee
    #
    # Build a method based on a {MethodDefinition::CallDefinition}
    class CallMethodBuilder < Base
      # Builds the method
      #
      # The build uses +module_eval+ over a class
      #
      # The code is ran either on the class itself or in
      # a block that allow creation of class methods
      #
      # @return [NilClass]
      def build
        evaluating_class.module_eval(&code_block)
      end

      delegate :code_block, to: :definition
      # @method code_block
      # @api private
      # @private
      #
      # Code block to be evaluated by the class
      #
      # @return [Proc]
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sinclair-2.1.1 lib/sinclair/method_builder/call_method_builder.rb
sinclair-2.1.0 lib/sinclair/method_builder/call_method_builder.rb
sinclair-2.0.1 lib/sinclair/method_builder/call_method_builder.rb
sinclair-2.0.0 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.16.3 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.16.2 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.16.1 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.16.0 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.15.0 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.14.2 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.14.1 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.14.0 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.13.0 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.12.1 lib/sinclair/method_builder/call_method_builder.rb
sinclair-1.12.0 lib/sinclair/method_builder/call_method_builder.rb