Skip to content

Commit

Permalink
README.md: Wrap lines at column 80
Browse files Browse the repository at this point in the history
  • Loading branch information
dmajda committed Jun 18, 2012
1 parent 0574e79 commit 4239af2
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions README.md
@@ -1,7 +1,8 @@
Abstract Method
===============

Abstract Method is a tiny library enabling you to define abstract methods in Ruby classes and modules.
Abstract Method is a tiny library enabling you to define abstract methods in
Ruby classes and modules.

Example
-------
Expand Down Expand Up @@ -35,7 +36,8 @@ First, require the library:
require "abstract_method"
```

You can now use the `abstract_method` method to define abstract methods in classes and modules.
You can now use the `abstract_method` method to define abstract methods in
classes and modules.

```ruby
class AbstractClass
Expand All @@ -47,7 +49,8 @@ class AbstractModule
end
```

When called, the abstract method will raise an `AbstractMethodCalled` exception with a helpful message:
When called, the abstract method will raise an `AbstractMethodCalled` exception
with a helpful message:

```ruby
AbstractClass.new.foo # raises AbstractMethodCalled with the following message:
Expand All @@ -67,15 +70,24 @@ end
ConcreteClass.new.foo # => 42
```

For more information, see the [API documentation](http://rubydoc.info/github/openSUSE/abstract_method/frames).
For more information, see the [API
documentation](http://rubydoc.info/github/openSUSE/abstract_method/frames).

FAQ
---

**Why define abstract methods? In a dynamic language like Ruby they aren't needed.**
**Why define abstract methods? In a dynamic language like Ruby they aren't
needed.**

Mainly for documentation purposes. The definitions allow subclass authors to easily see what they need to implement. They are also a great place to attach documentation.
Mainly for documentation purposes. The definitions allow subclass authors to
easily see what they need to implement. They are also a great place to attach
documentation.

**Why create a new library? There is already the [abstract](http://rubygems.org/gems/abstract) gem.**
**Why create a new library? There is already the
[abstract](http://rubygems.org/gems/abstract) gem.**

With the abstract gem you have to specify the abstract method parameter list in a string when you define it. This is ugly and in Ruby the parameter list often does not say much about the method anyway. The parameters should should rather be described using a code documentation system (such as [YARD](http://yardoc.org/)).
With the abstract gem you have to specify the abstract method parameter list in
a string when you define it. This is ugly and in Ruby the parameter list often
does not say much about the method anyway. The parameters should should rather
be described using a code documentation system (such as
[YARD](http://yardoc.org/)).

0 comments on commit 4239af2

Please sign in to comment.