<commit_before>## What Is It?

```ruby
class Duck
  def speak
    "Quack!\n"
  end

  def swim
    "I'm a great swimmer.\n"
  end
end
```



```ruby
class Imposter
  def speak
    "Believe me, I'm the best quacker in the world!\n"
  end

  def swim
    "I pay people to swim for me...\n"
  end
end
```



```ruby
mallard = Duck.new
donald = Imposter.new
```



```ruby
def ducks_go_quack duck
  puts duck.class.name + " Class says: " + duck.speak + " (via " + __method__.to_s + " method)\n\n"
end

def ducks_can_swim duck
  puts duck.class.name + " Class says: " + duck.swim + " (via " + __method__.to_s + " method)\n\n"
end
```



```
ducks_go_quack mallard
ducks_go_quack donald

ducks_can_swim mallard
ducks_can_swim donald
```



```
Duck Class says: Quack!
 (via ducks_go_quack method)

Imposter Class says: Believe me, I'm the best quacker in the world!
 (via ducks_go_quack method)

Duck Class says: I'm a great swimmer.
 (via ducks_can_swim method)

Imposter Class says: I pay people to swim for me...
 (via ducks_can_swim method)
```
<commit_msg>Update 2017-5-29-Duck-Typing.md<commit_after>## What Is It?

```ruby
class Duck
  def speak
    "Quack!\n"
  end

  def swim
    "I'm a great swimmer. Splash splash splash!\n"
  end
end
```



```ruby
class Imposter
  def speak
    "Believe me, I'm the best quacker in the world!\n"
  end

  def swim
    "I pay people to swim for me...\n"
  end
end
```



```ruby
mallard = Duck.new
donald = Imposter.new
```



```ruby
def ducks_go_quack duck
  puts duck.class.name + " says: " + duck.speak + " (via " + __method__.to_s + " method)\n\n"
end

def ducks_can_swim duck
  puts duck.class.name + " says: " + duck.swim + " (via " + __method__.to_s + " method)\n\n"
end
```



```
ducks_go_quack mallard
ducks_go_quack donald

ducks_can_swim mallard
ducks_can_swim donald
```



```
Duck says: Quack!
 (via ducks_go_quack method)

Imposter says: Believe me, I'm the best quacker in the world!
 (via ducks_go_quack method)

Duck says: I'm a great swimmer. Splash splash splash!
 (via ducks_can_swim method)

Imposter says: I pay people to swim for me...
 (via ducks_can_swim method)
```

{'fraction_non_alphanumeric': 0.12312734082397003, 'fraction_numerical': 0.0032771535580524347, 'mean_word_length': 3.2654690618762476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4098622', 'n_tokens_mistral': 915, 'n_tokens_neox': 819, 'n_words': 257}