Skip to content
Browse files

Source method exists, removed Headline.

  • Loading branch information...
1 parent 8760425 commit 3badd12cd426ac2ab20228c062a28255789e0731 @steveklabnik committed Sep 1, 2010
Showing with 18 additions and 11 deletions.
  1. +9 −11 README.md
  2. +2 −0 lib/extra/extra.rb
  3. +7 −0 spec/extra_spec.rb
View
20 README.md
@@ -45,24 +45,22 @@ To find out what interesting things a particular user has done:
$ user.read_all_about_it
-This returns an array of Headline objects. To find out more about a particular
- Headline:
+This returns an array of Extra objects. To find out more about a particular
+ Extra:
- $ headline = Extra::Extra::! :sports, user, "hit a home run!"
+ $ extra = Extra::Extra::! :sports, user, "hit a home run!"
-Yes, Extra::Extra::! is an alias for Headline.new. Sue me.
-
- $ headline.who?
+ $ extra.who?
=> #<User:0x0000010089ea80>
- $ headline.what?
+ $ extra.what?
=> "hit a home run"
- $ headline.where?
+ $ extra.where?
=> nil # currently undecided
- $ headline.when?
+ $ extra.when?
=> 1283311813
- $ headline.how?
+ $ extra.how?
=> nil # currently undecided
- $ headline.to_s
+ $ extra.to_s
=> "Steve hit a home run"
The name in to_s comes from user#username. If you use something else...
View
2 lib/extra/extra.rb
@@ -1,4 +1,6 @@
module Extra
class Extra
+ def self.source
+ end
end
end
View
7 spec/extra_spec.rb
@@ -4,4 +4,11 @@
it "should exist" do
extra = Extra::Extra.new
end
+
+ describe "#source" do
+ it "should exist" do
+ Extra::Extra.source
+ end
+
+ end
end

0 comments on commit 3badd12

Please sign in to comment.
Something went wrong with that request. Please try again.