class Patme::Method
Public Class Methods
new(name)
click to toggle source
# File lib/patme/method.rb, line 4 def initialize(name) @name = name @implementations = [] end
Public Instance Methods
add_implementation(implementation)
click to toggle source
# File lib/patme/method.rb, line 9 def add_implementation(implementation) @implementations << implementation end
call(object, args)
click to toggle source
# File lib/patme/method.rb, line 17 def call(object, args) @implementations.find{|i| i.match?(args)}.call(object, args) end
implemented_for?(args)
click to toggle source
# File lib/patme/method.rb, line 13 def implemented_for?(args) @implementations.any?{|i| i.match?(args)} end