Class: Shaped::Shapes::Method

Inherits:
Shaped::Shape show all
Defined in:
lib/shaped/shapes/method.rb

Instance Method Summary collapse

Constructor Details

#initialize(method_name) ⇒ Method

Returns a new instance of Method.



4
5
6
# File 'lib/shaped/shapes/method.rb', line 4

def initialize(method_name)
  @method_name = method_name
end

Instance Method Details

#matched_by?(object) ⇒ Boolean

Returns:



8
9
10
# File 'lib/shaped/shapes/method.rb', line 8

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

#to_sObject



12
13
14
# File 'lib/shaped/shapes/method.rb', line 12

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