Sha256: 393143e2f519fb610adcd7fbe27b1a0a2f93a50d67aa73f8419e79e02cd0ddfd

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true

module Yardcheck
  class MethodCall
    include Anima.new(
      :scope,
      :selector,
      :namespace,
      :params,
      :example_location,
      :return_value,
      :error_raised
    )

    def self.process(params:, return_value:, **attributes)
      params =
        params.map do |key, value|
          [key, TestValue.process(value)]
        end.to_h

      return_value = TestValue.process(return_value)

      new(params: params, return_value: return_value, **attributes)
    end

    def method_identifier
      [namespace, selector, scope]
    end

    def initialize?
      selector == :initialize && scope == :instance
    end

    def raised?
      error_raised
    end
  end # MethodCall
end # Yardcheck

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yardcheck-0.0.1 lib/yardcheck/method_call.rb