class RubyBreaker::TypeDefs::DuckType

This class represents any object with certain methods Usage: [m1,m2,…] where m1…mn are method names

Attributes

meth_names[RW]

This accessor sets/gets method names in the duck type.

Public Class Methods

new(meth_names=[],*args) click to toggle source
# File lib/rubybreaker/type/type.rb, line 122
def initialize(meth_names=[],*args)
  super(*args)
  @meth_names = meth_names.map!{|n| n.to_sym}
end

Public Instance Methods

add_meth(meth_name) click to toggle source
# File lib/rubybreaker/type/type.rb, line 126
def add_meth(meth_name)
  @meth_names << meth_name.to_sym if !@meth_names.include?(meth_name)
end