class DuckTesting::Type::DuckType

Attributes

name[R]

Public Class Methods

new(name) click to toggle source
# File lib/duck_testing/type/duck_type.rb, line 8
def initialize(name)
  @name = name
end

Public Instance Methods

match?(object) click to toggle source

@param object [Object] @return [Boolean]

# File lib/duck_testing/type/duck_type.rb, line 14
def match?(object)
  object.respond_to?(name)
end
to_s() click to toggle source

@return [String]

# File lib/duck_testing/type/duck_type.rb, line 19
def to_s
  "##{name}"
end