Permalink
Browse files

Move Moretext API URL to constant.

  • Loading branch information...
1 parent bb3faf9 commit e2c4f2f2b27ac1796bb9eafaac9917fe31da4d46 @chinghanho committed Mar 24, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/chh_moretext.rb
View
@@ -4,12 +4,14 @@
module ChhMoretext
class Base
+ MORETEXT_API_URL = "http://more.handlino.com/sentences.json"
+
class << self
def fetch_moretext(number, limit)
number = "n=#{number}"
limit = parse(limit)
condition = limit.nil? ? "?#{number}" : "?#{number}&#{limit}"
- return JSON(open("http://more.handlino.com/sentences.json#{condition}").read)["sentences"]
+ return JSON(open("#{MORETEXT_API_URL}#{condition}").read)["sentences"]
end
end

0 comments on commit e2c4f2f

Please sign in to comment.