# \[HUMOR\] Clinton just needs Ruby

**URL:** <https://www.ruby-forum.com/t/humor-clinton-just-needs-ruby/136103>\
**Category:** Rails\
**Created:** [April 28, 2008, 10:54pm UTC](https://www.ruby-forum.com/t/humor-clinton-just-needs-ruby/136103 "2008-04-28T22:54:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kschell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a698b9/32.png) [@kschell](https://www.ruby-forum.com/u/kschell)\
**Post date:** [April 28, 2008, 10:54pm UTC](https://www.ruby-forum.com/t/humor-clinton-just-needs-ruby/136103/1 "2008-04-28T22:54:54Z")

</div>

I heard today that Hillary Clinton’s only chance to win the Democratic  
primary is “to change the way math works”. Change math? Why do that  
when she could just use Ruby:

module DemocraticParty  
class Primary  
def delegate\_count  
return clinton.delegates, obama.delegates  
end  
end  
end

module ClintonRevisions  
def delegate\_count  
return (clinton.delegates\*1.3).ceil, (obama.delegates/1.3).floor  
end  
end

primary = DemocraticParty::Primary.new(2008)  
primary.extend(ClintonRevisions)  
primary.delegate\_count

The lesson: you may not be able to change the Primary but you can  
extend it! 😛

---

<div class="post-metadata">

**Author:** ![kschell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a698b9/32.png) [@kschell](https://www.ruby-forum.com/u/kschell)\
**Post date:** [April 29, 2008, 7:44am UTC](https://www.ruby-forum.com/t/humor-clinton-just-needs-ruby/136103/2 "2008-04-29T07:44:11Z")

</div>

This code is broken.

Why?

Because there’s no tests written for it.

Also, a Primary should be available to not only the DemocraticParty,  
but also the RepublicanParty. This is due to the country being a  
Democracy. Moving forth, the DemocraticParty should simply be called  
“Democrat”, as the RepublicanParty should also be called “Republican”.  
Both of these classes should inherit from Party, as they both have the  
same core setup. You should not be calling return in the  
delegate\_count method, since this will already return the last  
evaluated statement.

Continuing, the module “ClintonRevisions” should actually be  
“Revisions” with sub-modules of Clinton, Obama, Paul, and if necessary  
Giuliani (although I’ve heard rumours these last two may be deprecated  
in the future).

Glad to assist.
