Permalink
Browse files

fixes initializer to use board name

  • Loading branch information...
1 parent ca72c72 commit 672c2a201de668cfc61866c14bcdf9f9dd9a2e03 @tosik committed Apr 4, 2013
Showing with 7 additions and 8 deletions.
  1. +1 −1 README.md
  2. +5 −6 lib/ikioi/checker.rb
  3. +1 −1 lib/ikioi/version.rb
View
@@ -17,7 +17,7 @@ Or install it yourself as:
## Usage
```
-checker = Ikioi::Checker.new('keyword')
+checker = Ikioi::Checker.new('keyword', 'board_name')
checker.fetch
```
View
@@ -4,12 +4,11 @@
module Ikioi
class Checker
- def initialize(keyword)
- @keyword = keyword
- end
+ attr_reader :keyword, :board_name
- def keyword
- @keyword
+ def initialize(keyword, board_name)
+ @keyword = keyword
+ @board_name = board_name
end
def fetch
@@ -23,7 +22,7 @@ def parse(jsonp)
end
def fetch_jsonp
- open('http://2ch-ranking.net/ranking.json?board=gameswf').read
+ open("http://2ch-ranking.net/ranking.json?board=#{board_name}").read
end
end
View
@@ -1,3 +1,3 @@
module Ikioi
- VERSION = "0.0.1"
+ VERSION = "0.0.2"
end

0 comments on commit 672c2a2

Please sign in to comment.