gogotanaka / Rubype

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

Document inline syntax for Ruby 2.1 and newer #12

Open donv opened 9 years ago

donv commented 9 years ago

The Readme should document an alternative syntax usable in Ruby 2.1 and newer.

class MyClass
  typesig def by_four(i)
    i * 4
  end , [Integer] => Integer
end

If Rubype would allow trailing method name, it could look like this:

class MyClass
  typesig {[Integer] => Integer},
  def by_four(i)
    i * 4
  end
end