gogotanaka / Rubype

:dromedary_camel: Super simple, clean. Contracts for Ruby
http://gogotanaka.github.io/rubype.github.io/
377 stars 14 forks source link

Extract Contract class #30

Closed stefkin closed 9 years ago

stefkin commented 9 years ago

I was afraid to push it straight into develop. @gogotanaka, please review.

It helps to avoid passing ton of arguments to each method Refactoring haven't affected performance:

Calculating -------------------------------------
      Contract class    15.258k i/100ms
        Plain Rubype    15.129k i/100ms
-------------------------------------------------
      Contract class    281.862k (± 4.6%) i/s -      1.419M
        Plain Rubype    278.688k (± 4.7%) i/s -      1.392M

Comparison:
      Contract class:   281861.6 i/s
        Plain Rubype:   278688.4 i/s - 1.01x slower

alculating -------------------------------------
      Contract class    15.258k i/100ms
        Plain Rubype    15.129k i/100ms
-------------------------------------------------
      Contract class    281.862k (± 4.6%) i/s -      1.419M
        Plain Rubype    278.688k (± 4.7%) i/s -      1.392M

Comparison:
      Contract class:   281861.6 i/s
        Plain Rubype:   278688.4 i/s - 1.01x slower
gogotanaka commented 9 years ago

@bublik42 I really like this idea :+1:

gogotanaka commented 9 years ago

Fixed conflict and merged!!! Thank you so much!