Sha256: a165f2ab95def938607cf2a913d3ea05676c78f2d987c0d124154fa64c7768ca

Contents?: true

Size: 288 Bytes

Versions: 13

Compression:

Stored size: 288 Bytes

Contents

# frozen_string_literal: true

class Shaped::Shapes::Method < Shaped::Shape
  def initialize(method_name)
    @method_name = method_name
  end

  def matched_by?(object)
    !!object.public_send(@method_name)
  end

  def to_s
    "object returning truthy for ##{@method_name}"
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
shaped-0.14.0 lib/shaped/shapes/method.rb
shaped-0.13.0 lib/shaped/shapes/method.rb
shaped-0.12.0 lib/shaped/shapes/method.rb
shaped-0.11.0 lib/shaped/shapes/method.rb
shaped-0.10.0 lib/shaped/shapes/method.rb
shaped-0.9.1 lib/shaped/shapes/method.rb
shaped-0.9.0 lib/shaped/shapes/method.rb
shaped-0.8.2 lib/shaped/shapes/method.rb
shaped-0.8.0 lib/shaped/shapes/method.rb
shaped-0.7.3 lib/shaped/shapes/method.rb
shaped-0.7.2 lib/shaped/shapes/method.rb
shaped-0.7.1 lib/shaped/shapes/method.rb
shaped-0.7.0 lib/shaped/shapes/method.rb