lib/contribution_count/client.rb in contribution_count-0.1.0 vs lib/contribution_count/client.rb in contribution_count-0.1.2
- old
+ new
@@ -12,10 +12,15 @@
def today
today = Date.today.to_s
count_hash[today]
end
+ def contribution_today?
+ return false if today == 0
+ true
+ end
+
def yesterday
yesterday = (Date.today - 1).to_s
count_hash[yesterday]
end
@@ -26,9 +31,14 @@
def date(date)
return if date.nil?
count = count_hash[date]
raise NoDataError if count.nil?
count
+ end
+
+ def contribution?(date_str)
+ return false if date(date_str) == 0
+ true
end
private
def html
begin
\ No newline at end of file